What is the difference between "context" and "object"?

Rebol 3 has functions objectand context.

What is the purpose of the difference?

Note: for reference, red, both are the same, but objectdo not exist in rebol 2

Context: pun intended

At first, I was wondering why, contextinstead ofmake object!

Now, after studying the word objectused to create objects, I am curious to know why they are all different, and the rationale for different things to be the makesame.

Note that in rebol3:

object: make function! [[
    "Defines a unique object."
    blk [block!] "Object words and values (modified)"
][
    make object! append blk none
]]

It is append noneto block. What for? Is that just a minor difference? Does this deserve a separate question?

In all 3:

context: make function! [[
    "Defines a unique object."
    blk [block!] "Object words and values (modified)"
][
    make object! blk
]]

PS slight design differences between versions

+4
2

context Rebol2 make object! .

object Rebol3, collect-words, .

Red Rebol3 object, .

+5

context object . context Rebol2, , Rebol3 Red .

object Rebol3 Red ( R3 object [a: b: c:], )

, . context.

+3

Source: https://habr.com/ru/post/1665458/


All Articles