Re: [stack] stOck

John Nowak <[email protected]>
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
On Mar 11, 2009, at 6:54 AM, spir wrote:

> 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).

This is basically what dynamic scoping is. In fact, dynamic scoping is  
typically implemented using a stack (or series of stacks). If you're  
passing along some sort of dictionary, you're emulating dynamic  
scoping (and the problems that come with it).

> In a stack-based language (without world/env data outside the  
> stack), there cannot be any lexical scoping, or do I miss a point?

Dynamic scoping is concatenative; lexical scoping is not. Lexical  
scoping can be implemented by providing a translation from a non- 
concatenative language to a concatenative one. This is what is done in  
Factor. This generally only works if your language has first class  
functions (as otherwise getting the data into the right places is not  
possible).

- John
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.