Page 1 of 1

link function ?

Posted: Sun May 23, 2010 10:49 am
by ptbptb
I have been unable to find out what link does. It is not in the Xelerus list and all I have for it is (link ...). I've been looking to see if any existing mod uses it, but it doesn't seem very likely. Could someone solve this mystery? :P

Posted: Sun May 23, 2010 4:35 pm
by alterecco
(link ...) is a bit arcane. I am not sure I can come up with a correct description right now, since it has been some time since I looked at it. There is a post burried somewhere from george about it, somewhere in the rc threads I believe.

Basically what it does is take a string of tscript and transform it into something that is executable. Think of it as an eval, which doesn't actually evaluate the string, but returns something that can be evalled. I am not completely sure about it's use cases, but this might give you something to look at.

I have one function lying around where I use it, maybe it will give you a hint. It is a helper I wrote but never really used. You can see it here

Posted: Sun May 23, 2010 4:39 pm
by ptbptb
alterecco wrote:(I have one function lying around where I use it, maybe it will give you a hint. It is a helper I wrote but never really used. You can see it here
Looks a little esoteric for my poor brain - I shall have to contemplate it for a while. ;-)

Thanks for pointing to that function though - at least I'll have a bit of example code to quote.