Date: Mon, 29 Apr 2002 13:07:57 -0400
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Subject: Re: poll: user-defined readonly macro variable
Content-type: text/plain; charset=us-ascii
Many languages implement "constants" (eg:C++). Why not %Const construct that
allows you to _define_ and _initialize_ a macro variable? This can be thought of
as a superior form of "%Let".
eg: %Const MyMacroVar = SomeConstantValue ;
Why stop at macro? why not include a "const" statement in the DATASTEP, etc.
with the compiler kicking out a error if you (or a later programmer) tried to
modify that value in the datastep ?
Data NewData ;
Const TestValue "ConstantTestValue" ;
Const NumValue 2*3.14159 ;
Hmm, could that open the door to introducing function values in Const/Retain
statements, eg: Retain Const SASFunction(par1,...) ? That would be nice...imho.
Internet Mail Message
Received from host: malibu.cc.uga.edu
From: Paul Thompson <paul@WUBIOS.WUSTL.EDU> on 04/29/2002 04:46 PM GMT
Paul Thompson To: SAS-L@LISTSERV.UGA.EDU
<paul@WUBIOS.WUSTL.EDU> Cc: (bcc: Michael Bramley-M/PGI)
Subject: Re: poll: user-defined readonly
04/29/2002 12:46 PM
Please respond to Paul
Fehd, Ronald J. wrote:
>From: Shoemaker, Jack [mailto:firstname.lastname@example.org]
>>How about another macro declaration
>>to complement %global and %local,
>>say, %readonly? So, a macro my look like this:
>yes! that's a good idea!
>That options stuff always gets so complicated
>what with The Options Naming Committee and their Agenda.
>- - - - autoexec - - - -
>%LET A_SPECIAL_TYPE_OF_GLOBAL = some value;
>- - - autoexec end - - - -
>Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov
I like the idea. I use %global variables extensively. However, what
would be the rule to allow the value to be modified? Would you need to
set it once, and, once the %readonly condition was applied, it could not
be modified again?
The basic idea is very appealing.