Mailing List Archive

Does language have equivalent of LISP macros?
Is there a way to build up runtime code other than an
eval of a full statement or expr? ie, how would one go about

writing code which does the following:

$type = 'This';
"\$" . "$type" . "ID" = "This too";

Where one wants only the lpar to eval? That is to say, the
above evals to:

$ThisId = "This too";
Re: Does language have equivalent of LISP macros? [ In reply to ]
>Is there a way to build up runtime code other than an
>eval of a full statement or expr? ie, how would one go about

>writing code which does the following:

>$type = 'This';
>"\$" . "$type" . "ID" = "This too";

>Where one wants only the lpar to eval? That is to say, the
>above evals to:

>$ThisId = "This too";

Sure, assuming you aren't disallowing symbolic/soft references:

${ $type . "ID" } = "This too";


--tom
Re: Does language have equivalent of LISP macros? [ In reply to ]
From: Dale Amon <amon@walt.music.qub.ac.uk>
>
> Is there a way to build up runtime code other than an
> eval of a full statement or expr? ie, how would one go about
>
> writing code which does the following:
>
> $type = 'This';
> "\$" . "$type" . "ID" = "This too";
>
> Where one wants only the lpar to eval? That is to say, the
> above evals to:
>
> $ThisId = "This too";

Yes, try this

$type = 'This';
${ $type . "ID" } = "This too" ;

Paul