Re: [stack] stOck
spir <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <20090311115445.20d0ed47@o> |
Le Tue, 10 Mar 2009 18:23:03 -0400, John Nowak <[email protected]> s'exprima ainsi: > His proposal is equivalent to dynamic scoping. Locals in Factor are > lexically scoped. Excuse me to ask something that seems obvious to you: I simply don't understand. My proposal is about a kind of "namable" stack (stock). There are no additional variables, no variables outside the 'stock' (read: data flow from func to func). No locals in the usual sense neither, except if one calls 'locals', simply because they can be named, the data items that will be deleted when used in a func. There is no semantic difference between :div a b / :div / except the programmer does not need worrying about the stack order. (Sure, in this case naming is not very helpful cause the programmer will have to worry about ordering at call time ;-) In a stack-based language (without world/env data outside the stack), there cannot be any lexical scoping, or do I miss a point? One could call that dynamic scoping, as the data available to a func always come from the caller, but this does not make much sense imo in the absence of any other data source. It's kind of talking about composition, no? Adding the possibility to bind names to some of these data items does not change anything about the data flow: the data are the same, they follow the same path and 'die' when and where used as well: simply some are named in the aim of making the programmer's life nicer; by letting him give sensible names, avoiding stack juggling and dup-licating . If I remember well, you stated that a concatenative language needs not beeing stack-based. I understood that you meant the pack of data passed from func to func can be stored in another kind of data structure. Maybe I miss a trivial issue here; anyway, I guess this is precisely what my proposal is about. Denis ------ la vita e estrany