(( )) seems cool, and I look forward to playing with it. I'd like to use variables when a single word duplicates and consumes an object many times, a very common case in my programs. I suspect, however, that only one object in a word's stack effect typically needs this treatment.
Is there a middle ground where only one object is saved to a libs/ vars style variable without needing a separate (and global) VAR: declaration? Yuuki On Jan 11, 2007, at 4:37 PM, Daniel Ehrenberg wrote: > The problem with your (( )) macro is that it isn't automatically > scoped, and could lead to errors or confusion. Also, it encourages > abuse of variables, and is just unnecessary. > > On 1/11/07, Eduardo Cavazos <[EMAIL PROTECTED]> wrote: >> Hello, >> >> I'm working on a new vars vocabulary. This one works like so: >> >> VAR: foo >> >> That will generate the following words: >> >> : foo> ( -- val ) ! getter >> >> : >foo ( val -- ) ! setter >> >> : >>foo ( val -- ) ! set using set* >> >> : >>>foo ( val -- ) ! set using set-global >> >> And if you aren't already squirming, here's this one: >> >> : #foo ( -- ... ) ! Call the value of foo. E.g. >> "foo" get call >> >> In the old vars system, VAR: foo in addition to making getter and >> setter >> words, also setup up foo to be a symbol. In the system I changed >> it so "foo" >> is used as the variable. The main reason I was defining a symbol >> foo was to >> for let, but I might remove let anyway. >> >> I might make a parsing word for something like let: >> >> (( a b c )) will expand into >c >b >a >> >> : foo (( a b c )) >> a> b> * a> c> * + b> - ; >> >> Ed >> >> --------------------------------------------------------------------- >> ---- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to >> share your >> opinions on IT & business topics through brief surveys - and earn >> cash >> http://www.techsay.com/default.php? >> page=join.php&p=sourceforge&CID=DEVDEV >> _______________________________________________ >> Factor-talk mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/factor-talk >> > > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Factor-talk mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/factor-talk ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
