Re: understanding transient symbols, (====) and dynamic binding
On Wed, Apr 13, 2011 at 2:15 PM, Alexander Burger a...@software-lab.de wrote: Hi Edwin, if i understand correctly, () when called outside a method works only when a file is (load)ed? I'm not sure what you mean here. Isn't that the case for _any_ function? check. i realized this after sending my first email. To my understanding '' is a normal function, which clears the transient symbol table as a side effect. right. again, more insight. only the transient table is cleared, but the transient symbols themselves are left alone. additionally, the reference says: That means, a transient symbol cannot be accessed then by its name, and there may be several transient symbols in the system having the same name. i had a hard time understanding this until i checked the source, which just wipes out the transient hash table but leaves the heap alone. replying to myself, wrote a test... (de test1 () (if (not (num? ctr)) (setq ctr 1) (inc 'ctr) ) (prinl ctr) () ) (test1) (test1) (prinl ctr) did a face palm and tells myself that's how a static behaves in C!. did that explain that right? Yes, exactly. 'test1' will always refer to ctr, even if it is gone out of visibility (transient scope) for the outside world. after writing the test (damn, i should be writing more tests rather than asking...), reading the C code and reading and re-reading the reference i now have a clearer picture of how transient symbols are used. this is just part of unlearning i think. elegance! thank you Alex for sharing all of this. (wishful thinking: alternative syntax for representing transient symbols without embedded spaces. maybe something like \xxx) /e -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: understanding transient symbols, (====) and dynamic binding
On Wed, Apr 13, 2011 at 3:22 PM, Alexander Burger a...@software-lab.de wrote: Hi Edwin, (wishful thinking: alternative syntax for representing transient symbols without embedded spaces. maybe something like \xxx) Yeah, that's something I'm missing too. Transient symbols which represent not just strings simply look ugly. In fact, there exists something along that line, though not really a syntax in the traditional sense: Transient symbol markup. this is way too complex. perhaps i didn't express myself clearly. i was looking at something far simpler. at the moment, we have transient symbols as my transient symbols. this syntax for this is just fine. what if we can express MyParam, a transient symbol as \MyParam (or something similar) (a personal quirk, i dislike double quotes too much). maybe implement '\' as a read macro (?) to convert \MyParam to MyParam during read time. anyway, i'm not pushing this too much. was just thinking out loud. This is something tc.rucho and I were experimenting with for quite a while. You can see it going in and out over the years if you search for '*Tsm' in CHANGES. In the end (since 3.0.6) we disabled it by default, as it caused too much confusion. But the mechanics for *Tsm are still in the system (doc/refT.html#*Tsm). You can switch in on by loading lib/tsm.l: $ ./p lib/tsm.l + or $ ./dbg lib/tsm.l Transient symbol markup causes transient symbols to be displayed in an underlined font on the console, without the double quotes. Once you get used to it, it is a nice thing. The drawback is that it is difficult to be supported in most editors (tc.rucho implemented some support for it in emacs, and partially in vim). Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: understanding transient symbols, (====) and dynamic binding
Hi Edwin, at the moment, we have transient symbols as my transient symbols. this syntax for this is just fine. what if we can express MyParam, a transient symbol as \MyParam (or something similar) (a personal quirk, i dislike double quotes too much). I'm completely with you. In fact, the very first version of PicoLisp in 1988 used a colon, as :MyParam for transient symbols (strings were only available as lists of numbers). I was thinking of re-introducing a syntax like :MyParam, or perhaps MyParam, but this saves only a single character over MyParam, and doesn't look so very much better. The main reason of not doing this was that it adds yet another syntax rule, increasing the confusion about transient symbols. If both :MyParam and My Param are transient symbols, people will forget about the fact that they are the same internally, and then a statement where indeed a string must be assigned, like (setq My Parm Mein Parameter) as it is basically used for localization, will not be understood. Thus, the only way to have a _single_ syntax for symbols with and without spaces, a markup like underlining (or some other highlighting which also influences white space) seems the only consistent solution to me. maybe implement '\' as a read macro (?) to convert \MyParam to MyParam during read time. The backslash is already a read macro for escaping characters (in internal and transient symbols). For example: : (setq a\ b 123) - 123 : a\ b - 123 anyway, i'm not pushing this too much. was just thinking out loud. Not at all. This is an important issue, which also bites me quite some time. Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Unsubscribe
Good bye Vijay Mathew vijay.the.sche...@gmail.com :-( You are now unsubscribed -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: understanding transient symbols, (====) and dynamic binding
On Wed, Apr 13, 2011 at 10:57:17AM +0200, Alexander Burger wrote: I was thinking of re-introducing a syntax like :MyParam, or perhaps MyParam, but this saves only a single character over MyParam, and doesn't look so very much better. The main reason of not doing this was that it adds yet another syntax rule, increasing the confusion about transient symbols. If both :MyParam and My Param are transient symbols, people will forget about the fact that they are the same internally, and then a statement where indeed a I forgot to mention an even bigger problem if two alternative syntaxes are used for transient symbols: Which one should be used for output (print, pp, edit etc.)? Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: understanding transient symbols, (====) and dynamic binding
On Wed, Apr 13, 2011 at 7:45 PM, Alexander Burger a...@software-lab.de wrote: On Wed, Apr 13, 2011 at 10:57:17AM +0200, Alexander Burger wrote: I was thinking of re-introducing a syntax like :MyParam, or perhaps MyParam, but this saves only a single character over MyParam, and doesn't look so very much better. The main reason of not doing this was that it adds yet another syntax rule, increasing the confusion about transient symbols. If both :MyParam and My Param are transient symbols, people will forget about the fact that they are the same internally, and then a statement where indeed a I forgot to mention an even bigger problem if two alternative syntaxes are used for transient symbols: Which one should be used for output (print, pp, edit etc.)? more problems. :) will leave this for now and maybe someday when i understand the internals more i can present some solution. Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
unsubscribe
Good bye Scott Kurland scott.n.kurl...@gmail.com :-( You are now unsubscribed -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe