From: ·······@LoyalistC.ON.CA
Subject: Re: defun declarations
Date: 
Message-ID: <se3f76de.017@LoyalistC.ON.CA>
Item Type:  Note


||   ( defun foo ( x y ) ... )
||
||       How should 'x' and 'y' be handled in the global sense?  
|
|That doesn't sound right to me.  Wouldn't that make recursion a bit
|messy?
|

     First of all I'll tell you what I did...

     In my interpreter, all scoped variables must start with ·@', all
globals otherwise.  Therefore all variables created by (setq) may not
start with ·@', variables created by (set!)  (my scoped variable
declarator)  MUST start with ·@'.  
     In my defun declaration expression, variables starting with ·@'
are scoped, otherwise they are global.  

    ( defun foo ( x @y ) ... )
     x becomes global, whether previously declared or not.
     @y is local to (foo) and hides any other variables with the same
name.

     Now, why do you say this would make recursion difficult? 
Recursion is one of the reasons I considered doing this.  Global
variables, by definition, have only one instance.  Recursive methods
will have to account for this.  Locals on the other hand must hide
one another.  This requires memory management, and time consuming
re-organization in an already relatively slow process.  

     Am I doing something fundamentally wrong here?  This interpreter
will be dedicated to the service of a graphic terminal interface.  It
is intended that more literate users be able to maintain and improve
it.  Simplicity is priority one, functionality is next, with less
emphasis on being linguistically correct, (important never the less).

           But I don't want to make an AI faux-pas!

               Rick Graham, the Binary Workshop
  ·······@loyalistc.on.ca  Data:(613)476-4898  Fax:(613)476-1516