On Thu, Oct 1, 2009 at 1:34 PM, Hugh Aguilar <[email protected]> wrote:
> I was primarily confused because I didn't realize that in Factor some datums
> (tuples) are passed by reference, and some datums (numbers) are passed by
> value.

Actually, all data is passed by reference, however numbers are
immutable whereas a tuple is not (unless you declare all slots
read-only).

> A sequence
> with numbers in it would not be easily modified in place,

This is completely false,

11 { 10 17 5 } [ set-second ] keep .
=> { 10 11 5 }

> but a sequence
> with tuples in it would be easilty modified in place because the datums are
> all references to the original data that is someplace else.

You're confusing modifying a sequence in place with modifying objects
that it contains. The latter is possible even for elements in
immutable sequences, like quotations.

Slava

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to