On Jan 28, 2008 4:32 PM, Jorge Acereda MaciĆ” <[EMAIL PROTECTED]> wrote:
> Hi,
>
> After spending a couple of days with Factor a couple of (probably
> silly) questions come to mind:
>
> - Why does it use getters and setters instead of explicit words?
> (i.e, "my-tuple-field / set-my-tuple-field" instead of "my-tuple-
> field get / my-tuple-field set").
>
get and set take symbols (or any object) and look things up in a table
of the values of dynamically scoped variables. They don't do anything
with addresses, as the corresponding words in Forth would.

> How would you write something like this?
>
> : toggle ( addr -- ) dup @ 0= swap ! ;

: toggle ( variable -- ) [ not ] change ;

>
> - Why does it use "-" as the tuple/field separator? (i.e, "stream-
> parameters-frequency instead of something like stream-parameters/
> frequency). I think using the second form (like REBOL does) would
> make sources easier to read (the tuple part is easier to identify).
>
> TIA,
>     Jorge Acereda

That's a reasonable idea. There might be a big overhaul of tuple
setters soon, letting you completely leave out the tuple class name,
but personally I like that idea a lot.

I hope this helps!

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to