octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More subfunction scoping issues.


From: John W. Eaton
Subject: Re: More subfunction scoping issues.
Date: Wed, 4 Apr 2007 14:22:04 -0400

On 31-Mar-2007, David Bateman wrote:

| I'm a complete LEX/YACC novice and so the mention of the parser scares
| me off a bit. I believe that sub-functions have a symbol in the symbol
| table like "f:g". I therefore suppose that given the output of matlab
| that nested functions might have an entry in the symbol table like
| "f/g". This raises interesting possibilities like sub-functions of
| nested functions (ie "f/g:h") and nested functions in sub functions (ie
| "f:g/h") which are different.
| 
| I suppose we need an additional symbol table called for example
| parent_symbol_table, that is a copy of the parent table at the time the
| nested function is called. Given the example I posted function handles
| of nested-functions need to save the parent symbol table and share it
| with other nested-functions saved as function handles. This seems quite
| messy to get right. Getting it all right and hooking it in to the parser
| might be a little hard for me given my lack of LEX/YACC coding experience.

Another possibility is a major revision of the way symbol tables are
organized to simplify handling the new scoping rules.  Anyway, I think
doing this should wait until after 3.0.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]