In Rebol 3, there are the functions object
and context
.
What's the purpose of the difference?
Note : for reference, in red, both are the same, and object
doesn't exist
in rebol 2
Context: no pun intended
Initially, I was wondering why we had context
instead of make object!
Now, after learning of the object
word used to make objects,
I'm curious to know why they are all different and the rationale for having different things to make
the same thing.
Note that in rebol3:
object: make function! [[
"Defines a unique object."
blk [block!] "Object words and values (modified)"
][
make object! append blk none
]]
It append
s none
to the block. Why? Is this just a minor difference?
Does it deserve a separate question?
In all 3:
context: make function! [[
"Defines a unique object."
blk [block!] "Object words and values (modified)"
][
make object! blk
]]
P.S. slight differences in construction between the versions
context
andobject
serves same functionality.context
is from Rebol2 and I think it is exists in Rebol3 and Red for backward compatibility.object
exists in Rebol3 and Red and almost same (in R3 version it supportsobject [a: b: c:]
style, no big difference)So you can use any of them. I personally like
context
.