[Info-vax] defining a symbol as an action invoked when entered as command

VAXman- at SendSpamHere.ORG VAXman- at SendSpamHere.ORG
Sat Mar 28 09:08:20 EDT 2020


In article <e19ecc41-1531-49b3-9215-22fac304294f at googlegroups.com>, Bob Gezelter <gezelter at rlgsc.com> writes:
>On Saturday, March 28, 2020 at 5:21:56 AM UTC-4, Phillip Helbig (undress to reply) wrote:
>> I can do something like this in a command procedure:
>> 
>>    $ DEFINE/GROUP/NOLOG HERE 'F$ENVIRONMENT("DEFAULT")'
>>    $ EXIT
>> 
>> and define a symbol to run this procedure.  Works fine.
>> 
>> Is there anyway to get the same result as a symbol which gets evaluated 
>> only when entered as a command?
>
>Phillip,
>
>I am not sure what you are asking.
>
>You can define the command:
>
>$ HERE:= xxx 'F$ENVIRONMENT("DEFAULT")'
>
>Which will do xxxx with parameter of the (at the time of definition) current directory.
>
>What is the intended use case?

The problem here is that DCL will evaluate the 'F$environment("DEFAULT")' at
the time the symbol HERE is defined.  I believe Phillip would like the have
HERE return the current default.  To effect that, the parsing of the lexical
F$environment("DEFAULT") must be postponed until the symbol's translation is
performed.

-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

I speak to machines with the voice of humanity.



More information about the Info-vax mailing list