On Wednesday 02 July 2008 12:10:00 Joe Groff wrote:

> >     10 20 30 `{ , , , }
> > =>
> >     { 10 20 30 }
> >
> >
> >     10 { 21 22 23 } 30 `{ , , , }
> > =>
> >     { 10 { 21 22 23 } 30 }
> >
> >
> >     10 { 21 22 23 } 30 `{ , @ , }
> > =>
> >     { 10 21 22 23 30 }
>
> Out of curiosity, why do you use backtick in bake (`{) but apostrophe
> in fry ('[)?

Good question.

Bake is much older than fry. At the time, I borrowed backquote from Lisp. 
Eventually fry came along and I think we felt that we should use something 
besides backquote because the semantics were so different. Well, at the time 
the semantics were very different. Items were baked in reverse order. The set 
of directives was also disjoint. For example there were ,[ and %[ directives:

        `{ 10 ,[ 1 1 + ] 20 }   =>      { 10 2 20 }

I.e. ,[ inserts the value of the directive in place. %[ was similar but it 
spliced the value.

However, now bake is very similar to fry. All the old usages of bake have been 
updated. The extra directives were removed for now.

I was going to mention this in a separate email but I'll bring it up here.

Bake now supports vectors and quotations in addition to arrays. It's 
conceivable that bake could be extended to handle any kind of collection 
literal.

Bake is now as powerful as 'fry' sans support for the '_' directive in 
quotations. Were support for '_' added, bake would fully support fry 
semantics. At that point it would be possible to remove fry and only have the 
all powerful bake. This would clean up the syntax; we'd only need one or the 
other of backquote or quote.

Ed

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to