World: r3wp
[!REBOL3-OLD1]
older newer | first last |
Maxim 21-Aug-2009 [16858] | you really think he meant you? you're giving yourself to much importance ;-p |
Steeve 21-Aug-2009 [16859] | Did you noticed that too ? |
Maxim 21-Aug-2009 [16860] | I did actually hehehe |
Steeve 21-Aug-2009 [16861] | About set-block and get-block. If it's only to save the use of SET and REDUCE, i think it's a little luxurious. |
Henrik 21-Aug-2009 [16862] | It would have to work like set-word!s for contexts, to have more meaning. Could save a line of code. |
Steeve 21-Aug-2009 [16863] | I don't see your point Henrik, can u give an example |
Henrik 21-Aug-2009 [16864] | context [ foo: fum: none set [foo fum] 3 ] 'foo and 'fum stays in context with the NONE line. Without it, they don't. |
Steeve 21-Aug-2009 [16865] | ... it's not a good example ;-) i do this, context [foo: fum: 3] |
Henrik 21-Aug-2009 [16866x3] | whoops, I meant like the get-block example above. |
set [foo fum] [3 5] | |
could also reduce the size of some object specifications: ret-value: [test 7] make object! [ [fnc arg]: :ret-value ] | |
Steeve 21-Aug-2009 [16869] | you can with R3 >> set c: construct [a: b:] [3 5] == [3 5] >> c == make object! [ a: 3 b: 5 ] |
Henrik 21-Aug-2009 [16870x2] | or more generally: it can occur often that you need to set multiple words sequentially. there should be a syntax for that. |
steeve, contexts usually contain much more than that, so CONSTRUCT is very limiting here. | |
Steeve 21-Aug-2009 [16872x2] | it works with CONTEXT too |
set c: context [a: b: none] [3 5] | |
Henrik 21-Aug-2009 [16874] | same problem |
Maxim 21-Aug-2009 [16875] | To me EEBOL is about syntax, and the get block set block idea seems very interesting. |
Henrik 21-Aug-2009 [16876] | what happens when you say: [a [b c]: d]: [1 [2 3] 4] |
Steeve 21-Aug-2009 [16877] | very rebolish, but is that very usefull ? |
Maxim 21-Aug-2009 [16878] | its just like op vs function notation to me... z: ADD x y vs z: x + y |
Henrik 21-Aug-2009 [16879] | I'm not sure it is. :-) but many things don't seem very useful on the surface. I'm still thinking in terms of setting mulitple words with multiple values in one operation. I hate picking words out of a block, one at a time. It becomes more powerful when you replace the blocks with words. Then you can use the same program structure to set one-to-many, one-to-one, many-to-one and many-to-many words. |
Maxim 21-Aug-2009 [16880] | yep... like : z: [b c] [a :z d]: [1 [2 3] 4] |
Steeve 21-Aug-2009 [16881] | rough |
Maxim 21-Aug-2009 [16882] | if z s a word, IT gets assigned [1 2] if z is a get-word, its content is assigned to the content [1 2], so in the above, b and c would be 1 and 2 respectively. |
Henrik 21-Aug-2009 [16883] | but then: z: [b c] :z: [3 4] or what? :-) |
Steeve 21-Aug-2009 [16884x4] | i would prefer another syntax to assign the content instead of the container |
z:: [3 4] | |
double : | |
not bad eh ? | |
Maxim 21-Aug-2009 [16888x4] | well, its the current syntax :z already means what I contain. |
double colon makes no sense... what are you assigning to z? a new datatype? | |
but Henrik's :z: has me puzzled here: [a :z: d]: [1 [2 3] 4] what would the above mean? hehe | |
(in current form of syntax) | |
Steeve 21-Aug-2009 [16892] | and what is your :z: ? a new datatype too, much more confusing to my mind |
Maxim 21-Aug-2009 [16893x2] | no :z already exists. if z where a function, it returns the function itself, not its evaluation. |
get words returns the content of the word without evaluating them. | |
Steeve 21-Aug-2009 [16895x3] | i don't speak about that |
but :z: | |
that is a new datatype, a GET-SET | |
Maxim 21-Aug-2009 [16898x2] | ahhh... sorry, didn't see the last colon. |
it already exists too! | |
Steeve 21-Aug-2009 [16900] | no |
Maxim 21-Aug-2009 [16901x3] | it does in path notation. its also silently ignored in the command line as long as the get-set word actually holds a word within :-) |
>> y: 'c >> probe :y: func [][print "2"] >> c but it should assign the function to c... its logical actually. | |
in a path, it works though. | |
Steeve 21-Aug-2009 [16904x2] | but in plain REBOL, it has to be a new datatype |
the path evaluation use another one scheme | |
Maxim 21-Aug-2009 [16906] | not, it should just do like in the path notation, get the value of the word, and set to that value . |
Steeve 21-Aug-2009 [16907] | n |
older newer | first last |