> Basic syntax:
>
> TUPLE: color red green blue ;
>
> Typed slots:
>
> TUPLE: color red/int green/int blue/int ;
>
> Slots with initial values:
>
> TUPLE: color red=0 green=0 blue=0 ;
>
> Typed slots with initial values:
>
> TUPLE: color red/int=0 green/int=0 blue/int=0 ;
I sympathize with your desire to Huffman-code common source patterns.
But I think it's a really bad idea to start introducing sub-word-level
syntax. The whitespace-delimited word is the atomic level of data in
most Factor code, and breaking that rule should only be considered in
exceptionally special circumstances; it'll confuse new users who have
to learn "whitespace separates everything, except in method stack
effects, typed tuple slots, and all the libraries following their bad
example." It'll also make parsing and writing tools for dealing with
Factor code (editor support, etc.) more complex. As Slava pointed out,
you aren't going to be putting types or default values on most tuple
slots, only ones where performance, correctness, or documentary
concerns demand them. I assume "TUPLE: color red blue green ;" will
still work, and that'll be fine for 90% of code using tuples. Having
to reach for the shift key to put { } around typed slots is an
acceptable cost for that other 10%; it preserves the regularity of the
language syntax and maps straightforwardly to the underlying runtime
code.
I do agree with you that putting quotation marks around the tuple
names is whacked.
-Joe
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk