Re: Block comment and unescape string

2009-05-08 Thread Kriangkrai Soatthiyanont
Hi Alex and Henrik, > Is Kriangkrai acceptable, too? Sure. Kriangkrai is my first name. KS is from K for Kriangkrai (my first name) and S for Soatthiyanont (my surname). > Kriangkrai Soatthiyanont sounds Thai Yes, I'm Thai. Sawadee Krub :-) Best regards, KS -- UNSUBSCRIBE: mailto:picol...@softw

Re: Block comment and unescape string

2009-05-08 Thread Henrik Sarvell
>>Is Kriangkrai acceptable, too?<< Kriangkrai Soatthiyanont sounds Thai, but maybe I was mistaken, if I wasn't there is a short, usually 3 letter name that is easier to use :-). /Henrik On Fri, May 8, 2009 at 4:43 PM, Alexander Burger wrote: > Hi Kriangkrai, > >> You may call me KS. > > Really

Re: Block comment and unescape string

2009-05-08 Thread Alexander Burger
Hi Henrik, > Alright, up to Alex but if it makes the interpreter slower then I'm against= > it. No reason to worry. I'm sure the impact is minimal. Cheers, - Alex -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Re: Block comment and unescape string

2009-05-08 Thread Alexander Burger
Hi Kriangkrai, > You may call me KS. Really? I was also not sure how to call you ;-) Is Kriangkrai acceptable, too? Cheers, - Alex -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Re: Block comment and unescape string

2009-05-08 Thread Kriangkrai Soatthiyanont
Hi Henrik, You may call me KS. It's NOT my intention to fork Pico Lisp! I just need some features. If I can do them myself, I implement and share them back. If I do not know how, I request them or ask for an alternative solution. It's OK for my contribution to not be included in standard Pico Lis

Re: Block comment and unescape string

2009-05-08 Thread Alexander Burger
Hi Kriangkrai, > Thanks for making it nestable. I like your code. ;-) Thanks :-) However, after thinking about it and Henrik's comment, I thought I better leave it non-nesting. This is simpler, cleaner, and less risky (due to the mentioned dangers of breaking it). I think it is an optimal comprom

Re: Block comment and unescape string

2009-05-08 Thread Alexander Burger
Hi Kriangkrai, > One problem with 'fill' is that the expressions to fill cannot be > anonymous (it must be the result of a variable), e.g. to fill the That's true. > That's true if such functions (e.g. , , ...) already exist. Yes, they do, e.g. in "lib/xhtml.l". They are a little bit described

Re: Block comment and unescape string

2009-05-08 Thread Henrik Sarvell
Alright, up to Alex but if it makes the interpreter slower then I'm against= it. The reason I'm using Pico Lisp is because it's faster than the alternatives (Ruby, Python). Maybe it's time then to start with a Maxi Pico Lisp? You could put the Maxi version under Mercurial control, whenever Alex

Re: Block comment and unescape string

2009-05-08 Thread Henrik Sarvell
Hi Kriangkrai (what is your short name?). This is a matter of taste, I actually like the way because that makes it easy for me to differentiate them from system functions. Check out the xhtml.l file for both those functions and the tag function. /Henrik On Fri, May 8, 2009 at 3:24 PM, Kriangkr

Re: Block comment and unescape string

2009-05-08 Thread Kriangkrai Soatthiyanont
Hi Henrik, My purpose of block comment is not to comment out multiple lines, for that I would use single line comments too. I would use block comment to comment out small part in a line, e.g. (list 1 2 #{3 4}# 5) or to comment within context, e.g. (de f (A #{...}# B #{...}#)

Re: Block comment and unescape string

2009-05-08 Thread Kriangkrai Soatthiyanont
Hi Alex, Thanks for making it nestable. I like your code. ;-) Best regards, KS On 5/8/09, Alexander Burger wrote: > On Fri, May 08, 2009 at 09:48:05AM +0200, Alexander Burger wrote: >> Because: If the commented text contains the pattern "#{" or "}#" in a >> context where it is not relevant as a

Re: Block comment and unescape string

2009-05-08 Thread Kriangkrai Soatthiyanont
Hi Alex, > (let (Clr "#EEE" Cls "xxx") >(fill > '(html > (body (style "background-color:" Clr) > (div (class Cls)) ) ) > '(Clr Cls) ) ) One problem with 'fill' is that the expressions to fill cannot be anonymous (it must be the result of a variable), e.g. to f

Re: Block comment and unescape string

2009-05-08 Thread Alexander Burger
Hi Henrik, > Let's not make the interpreter more complicated for nothing. This is something I wholeheartedly agree :-) Cheers, - Alex -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Re: Block comment and unescape string

2009-05-08 Thread Henrik Sarvell
I've implemented simply selecting a slew of lines in my editor, hitting ctrl-t and they're all single line commented. I'm sure this can be done in VIM too with some work (if it isn't there already). Anyway, after doing that I never wished for multi line comments again. Let's not make the interpre

Re: Block comment and unescape string

2009-05-08 Thread Alexander Burger
On Fri, May 08, 2009 at 09:48:05AM +0200, Alexander Burger wrote: > Because: If the commented text contains the pattern "#{" or "}#" in a > context where it is not relevant as a comment (e.g. in a symbol name or > a string), the nesting will break. Sorry, I'm stupid! Nesting or not, these block c

Re: Block comment and unescape string

2009-05-08 Thread Alexander Burger
On Fri, May 08, 2009 at 09:21:54AM +0200, Alexander Burger wrote: > True. I'll better make it nesting, using a simple level counter. Hm, thinking about it, I'm not so sure ... A working solution would be static int skip(int c) { for (;;) { if (Chr < 0) return Chr;

Re: Block comment and unescape string

2009-05-08 Thread Alexander Burger
Hi Kriangkrai & Tomas, > it is not great that #{ }# does not nest:-( True. I'll better make it nesting, using a simple level counter. > >~(as > > ... > What about some more concise syntax, e.g. > > ~~ , e.g. ~~NIL(body ...) or something like that? Well, the nice thing with 'as' is that i

Re: Block comment and unescape string

2009-05-08 Thread Tomas Hlavaty
Hi Kriangkrai & Alex, > In fact, my #{...}# syntax is inspired by the #|...|# syntax in PLT > Scheme (but in PLT, it can be nested, unlike my implementation ;-) it is not great that #{ }# does not nest:-( >... >~(as > body > ... ) >... > > The list with 'body' will not b

Re: Block comment and unescape string

2009-05-07 Thread Alexander Burger
Hi Kriangkrai, > It would be great if PicoLisp have "quasi-quotation", so the code > could be something like: > > (out "t.html" >(sxml > (let (Clr "#EEE" Cls "xxx") > `(html > (body (@ style "background-color:" ,Clr) >(div (@ class ,Cls)) ) Ther

Re: Block comment and unescape string

2009-05-07 Thread Alexander Burger
Hi Kriangkrai, > Yes, it's ok to include only block comment :-) Great! Thanks for the contribution! I released it now in "picoLisp.tgz" and also "miniPicoLisp.tgz". Cheers, - Alex -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Re: Block comment and unescape string

2009-05-07 Thread Alexander Burger
Hi Tomas, > well, #+NIL(...) seems a bit long, but it is actually a conditional > comment where the condition is NIL in this case. Ah, I see! Well, in PicoLisp there is also a kind of "conditional compilation" which I use quite frequently. It is the read macro operator '~' (tilde) in combination

Re: Block comment and unescape string

2009-05-07 Thread Kriangkrai Soatthiyanont
Hi Tomas, Thanks for the code. But my intension for unescaped string is for "casual" template (most of text are static strings) and embedding files (without creating separate files). It would be great if PicoLisp have "quasi-quotation", so the code could be something like: (out "t.html" (sxml

Re: Block comment and unescape string

2009-05-07 Thread Kriangkrai Soatthiyanont
Just to correct my mistake. It is "#;", not "#'", for single-expression comment in PLT Scheme. On Fri, May 8, 2009 at 1:53 AM, Kriangkrai Soatthiyanont wrote: > Hi Alex and Tomas, > > In PLT Scheme, you can comment out a single expression with "#'" (e.g. > ... #'(+ 1 2) ...). It would be great t

Re: Block comment and unescape string

2009-05-07 Thread Tomas Hlavaty
Hi Kriangkrai, >> But what if we want to mix it with expressions? >> >>(let (Clr "#EEE" Cls "xxx") >> (pack {$ >> >> >> $} )) I would suggest: (de style Lst (let S NIL (while Lst (let (K (pop 'Lst) V (eval (pop 'Lst) 1)) (whe

Re: Block comment and unescape string

2009-05-07 Thread Tomas Hlavaty
Hi Alex, >> something which would not make me edit both ends of the commented out >> expression, e.g. Common Lisp #+NIL(...) is better in that sense as you >> can stay at the beginning all the time when commenting or > > I personally find the token '#+NIL' a bit too long (a typical Common > Lisp s

Re: Block comment and unescape string

2009-05-07 Thread Kriangkrai Soatthiyanont
Hi Alex and Tomas, In PLT Scheme, you can comment out a single expression with "#'" (e.g. .. #'(+ 1 2) ...). It would be great to have such kind of comment too, but I don't know how to do it easily. :-( In fact, my #{...}# syntax is inspired by the #|...|# syntax in PLT Scheme (but in PLT, it can

Re: Block comment and unescape string

2009-05-07 Thread Kriangkrai Soatthiyanont
Hi Alex, Yes, it's ok to include only block comment :-) Best regards, KS On Fri, May 8, 2009 at 1:20 AM, Alexander Burger wrot= e: > Hi Kriangkrai, > >> But what if we want to mix it with expressions? >> >> =A0 =A0(let (Clr "#EEE" =A0Cls "xxx") >> =A0 =A0 =A0 (pack {$ >> =A0 =A0 =A0 =A0 =A0 >>

Re: Block comment and unescape string

2009-05-07 Thread Alexander Burger
Hi Tomas, > something which would not make me edit both ends of the commented out > expression, e.g. Common Lisp #+NIL(...) is better in that sense as you > can stay at the beginning all the time when commenting or I personally find the token '#+NIL' a bit too long (a typical Common Lisp style).

Re: Block comment and unescape string

2009-05-07 Thread Alexander Burger
Hi Kriangkrai, > But what if we want to mix it with expressions? > >(let (Clr "#EEE" Cls "xxx") > (pack {$ > > > $} )) Then it gets indeed a bit clumsy, but you can use multiple 'here's and suitable delimiters: (let (Clr "#EEE" Cls "xxx") (here "<1>")

Re: Block comment and unescape string

2009-05-07 Thread Tomas Hlavaty
Hi Kriangkrai, > I have a patch to add block comment (#{}#) it would be nice to have block comments. I would actually prefer something which would not make me edit both ends of the commented out expression, e.g. Common Lisp #+NIL(...) is better in that sense as you can stay at the beginning

Re: Block comment and unescape string

2009-05-07 Thread Tomas Hlavaty
Hi Kriangkrai, > that, we can generate files easily, e.g. > > (out "t.html" (prin {$ style="background-color:#EEE">... class="xxx">..$})) you can try @lib/html.l or @lib/xml.l to achieve that better: (out "t.html" ( NIL ( html ( body style "background-color:#EEE"

Re: Block comment and unescape string

2009-05-07 Thread Kriangkrai Soatthiyanont
Hi Alex, > BTW, I think using 'here' you can achieve something similar, but without > any danger of conflict: > > =A0 (out "t.html" (here)) > =A0 > =A0 > =A0 > =A0 But what if we want to mix it with expressions? (let (Clr "#EEE" Cls "xxx") (pack {$ $} )

Re: Block comment and unescape string

2009-05-07 Thread Alexander Burger
Hi Kriangkrai, > "\^"), well except ensuring that there is no "$}" in the string. With > that, we can generate files easily, e.g. > > (out "t.html" (prin {$ style="background-color:#EEE">... class="xxx">..$})) I see your point, but it seems a little overkill to me for such cases. BTW, I thi

Re: Block comment and unescape string

2009-05-07 Thread Kriangkrai Soatthiyanont
u, May 7, 2009 at 7:45 PM, Alexander Burger wrote: > Hi Kriangkrai, > >> I have a patch to add block comment (#{}#) and unescape string >> ({$.$}) syntax. > > I think the block comments are a great idea. Such a feature was missing, > and I like the above syntax.

Re: Block comment and unescape string

2009-05-07 Thread Alexander Burger
Hi Kriangkrai, > I have a patch to add block comment (#{}#) and unescape string > ({$.$}) syntax. I think the block comments are a great idea. Such a feature was missing, and I like the above syntax. But I'm a bit reluctant about the unescaped strings. Why do you think th

Block comment and unescape string

2009-05-07 Thread Kriangkrai Soatthiyanont
Hi Alex, I have a patch to add block comment (#{}#) and unescape string ({$.$}) syntax. Do you think that the syntax will affect old code? Should it be added to the standard distribution? Best regards, KS io.c.patch Description: Binary data