|
|
| Author |
Message |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 3183 Location: italy
|
|
|
|
| Quote: |
| I would like that REXX has real data types, structures, memory pointers... Am I asking too much |
yes |
|
| Back to top |
|
 |
References
|
|
 |
helga
New User
Joined: 11 Sep 2006 Posts: 24
|
|
|
|
Interesting
| Code: |
| say "stem.var" stem.var |
So if a 'variable' has never had a value, then it's not really a variable. It's a litteral.
===
| Code: |
say "stem.var" stem.var
var = "AAA"
say "stem.var" stem.var |
So a compound variable still isn't a variable until it gets a value, though if a part of it gets a value, that bit is a variable
===
| Code: |
say "stem.var" stem.var
var = "AAA"
stem.var = "bbb"
say "stem.var" stem.var
say "stem.AAA" stem.AAA |
And now because the compound variable is given a value, it becomes a variable, but not only that, the part of it that got a value (var) is also a variable, so the compound variable can be refered to using either the variable var or the value of the variable var (AAA).
I wonder if they are the same thing . . .
===
| Code: |
say "stem.var" stem.var
var = "AAA"
stem.var = "bbb"
say "stem.var" stem.var
say "stem.AAA" stem.AAA
stem.AAA = "ccc"
say "stem.var" stem.var
say "stem.AAA" stem.AAA |
stem.var and stem.AAA appear to be the same thing.
...well it's a little confusing
but then again, it's probably only like saying
| Code: |
WRITE "ARRAY(var)" ARRAY(var)
var = 1
ARRAY(var) = "bbb"
WRITE "ARRAY(var)" ARRAY(var)
WRITE "ARRAY(1)" ARRAY(1)
ARRAY(1) = "ccc"
WRITE "ARRAY(var)" ARRAY(var)
WRITE "ARRAY(1)" ARRAY(1)
|
|
|
| Back to top |
|
 |
XOpen
New User
Joined: 19 Mar 2008 Posts: 25 Location: Russia
|
|
|
|
confusing, but amazing at the same time.
It allows creating variables on fly and get them, like by key in database. It's rare thing that I like in REXX, but there is nothing similar in ASM. So this high logic can be very resource consuming. |
|
| Back to top |
|
 |
Robert Sample
Senior Member
Joined: 06 Jun 2008 Posts: 952 Location: Atlanta, GA
|
|
|
|
Learn Perl sometime. It defines variables on first use, has case-sensitive variable names, and the same name can represent different things depending on the first character of the name. Not to mention the automatic conversion from numeric to string and vice-versa: you can say in Perl
| Code: |
| my $var = 3.5 + "Four"; |
and Perl proceeds merrily (deciding that since there's no digits in "Four" that the value must be 0 and therefore var has the value of 3.5). |
|
| Back to top |
|
 |
|
|