jed-users mailing list

[2003 Date Index] [2003 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [jed-users] setting programming style


I wrote:
> Is there any way to avoid eval when assigning to a variable only known by
> it's name string (like with associative arrays)?

define assbyname( keyword, value)
{
   if ( keyword == NULL) return @value= $1;
   if ( is_defined( keyword) >= 0)
     error( "unallowed keyword in "+_function_name);
   
   $1= value;
   eval( "assbyname(,&"+keyword+")");
}

Improvements welcome :)

Klaus


--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2003 date index] [2003 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]