[Coco] CCASM procedures

KnudsenMJ at aol.com KnudsenMJ at aol.com
Fri Dec 10 13:15:55 EST 2004


 
In a message dated 12/9/04 11:54:50 PM Eastern Standard Time,  
rtaylor at bayou.com writes:

Procedures/subprograms are based on isolation.  A procedure or  subprogram 
should not know anything (give or take) about the outside world  or calling 
program,


You DO want to allow for global variables, as part of the procedure's  
environment.
Granted, these are not useful in a library procedure, but when a user is  
writing subs of functions just for use in the same program, he should be able to  
reference global variables (from the main program) in the procedure code.
 
Of course when compiling code for a library, global variables would show up  
as undefined, thus enforcing the rule.  However, consider such  
well-publicized globals as "errno" in C's stdio library.  That is, even  libraries subs can 
have globals, if these are explained in the docs and header  files needed to 
use the library.
 
Lack of global variables in procedures (and lack of return values) were one  
of Basic09's major shortcomings (plus awkward character handling and a 
horrible  editor).
--Mike K.
 



More information about the Coco mailing list