|
| Re: defining ! |
 |
Wed, 10 Oct 2007 13:55:26 +010 |
John Roberts wrote:
> It is not possible now but is it going to be possible to do
> string s
> s = "mytext"
> t!"mystring" + s = value
> or t!mystring + s = value
I don't think this is planned. If you think about it, it would actually
require this sort of syntax:
s = "mytext"
t!("mystring" + s) = value
I can see why you might want to do this, but at the same time, there is
almost no real reason to do it that way. Essentially the question
revolves around using the member operator to access a member of a list
where the name of the member is not known at compile time. The thing is,
to get the name you have to have accessed the member at some point, so
you could just as easily have stored the reference to it rather than the
name for reaccessing the item.
|
| Post Reply
|
| defining ! |
 |
Wed, 10 Oct 2007 16:25:30 +080 |
It is not possible now but is it going to be possible to do
string s
s = "mytext"
t!"mystring" + s = value
or t!mystring + s = value
John
|
| Post Reply
|
| Re: defining ! |
 |
Thu, 11 Oct 2007 18:32:44 +080 |
"Neil Robinson" <neil@simpol.com> wrote in message
news:feii41$mah$1@ipx22096.ipxserver.de...
> John Roberts wrote:
>> It is not possible now but is it going to be possible to do
>> string s
>> s = "mytext"
>> t!"mystring" + s = value
>> or t!mystring + s = value
>
> I don't think this is planned. If you think about it, it would actually
> require this sort of syntax:
>
> s = "mytext"
> t!("mystring" + s) = value
>
> I can see why you might want to do this, but at the same time, there is
> almost no real reason to do it that way. Essentially the question
> revolves around using the member operator to access a member of a list
> where the name of the member is not known at compile time. The thing is,
> to get the name you have to have accessed the member at some point, so
> you could just as easily have stored the reference to it rather than the
> name for reaccessing the item.
>
> Ciao, Neil
Good point. It isn't necessary.
John
|
| Post Reply
|
|
|
|
|
|
|
|
|
|