November 30, 2001 $ in identifier names | ||||
---|---|---|---|---|
| ||||
G'Day, gcc and old c compilers used to allow $ in identifiers. Personally, I find this handy as you cannot get a name clash. The background is that I have programs that generate other programs (compile and then run them in the background) from input the users have given. For example is a user requests "restrict '$date<20010101'", the program might generate: while( getrecord(in,record) ) { const string $cust = record[0]; const string $date = record[1]; : if( numeric($date)<20010101 ) putrecord(out,record); } Just a thought! -- Paul Mathews |
November 30, 2001 Re: $ in identifier names | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paul Matthews | I've been leaving that option open by avoiding using $ or @ as operator tokens. -Walter "Paul Matthews" <plm@pcug.org.au> wrote in message news:3C074DFD.3645FE86@pcug.org.au... > G'Day, > > gcc and old c compilers used to allow $ in identifiers. Personally, I find this handy as you cannot get a name clash. > > The background is that I have programs that generate other programs (compile and then run them in the background) from input the users have given. > > For example is a user requests "restrict '$date<20010101'", the program might generate: > > while( getrecord(in,record) ) > { > const string $cust = record[0]; > const string $date = record[1]; > : > if( numeric($date)<20010101 ) > putrecord(out,record); > } > > Just a thought! > > -- > Paul Mathews |
Copyright © 1999-2021 by the D Language Foundation