REBOL 3.0

Comments on: Deprecate CONTEXT?

Carl Sassenrath, CTO
REBOL Technologies
11-Feb-2007 18:51 GMT

Article #0059
Main page || Index || Prior Article [0058] || Next Article [0060] || 24 Comments || Send feedback

As you know, REBOL defines the word context as a shortcut for:

make object! [...]

I've noticed that many developers do not use context, electing to use make object! instead. That's fine. I'm often reluctant to use context myself, but I end up using it anyway because it's short and sweet.

The question is, do we want to keep context for REBOL 3.0?

This is one of those subtle naming problems. The context function creates an object, not really a context. There is a close relationship between the two, but they are not identical. So, context as a function is a misnomer.

All of this may seem trivial, and in the bigger picture, it is. But, there are quite a few of these little "loose ends" that I'd like to resolve and nail down for REBOL 3.0.

If we want to deprecate context, as perhaps we should, what do you think we would use instead?

Using a pattern similar to the func function shortcut, some possibilities are:

object [...]
obj [...]
to-object [...] ; assuming TO does what we want

Other ideas?

24 Comments

Comments:

Oldes
11-Feb-2007 15:04:01
I'm one of these who still prefer the old way (make object! [])
But I like to-object [] if I have to vote for something.
Mario Cassani
11-Feb-2007 15:16:56
I agree with Oldes.
It "sticks" with the generic types syntax and behaviour:

>> make integer! "1"
== 1
>> type? make integer! "1"
== integer!
>> to-integer "1"
== 1
>> type? to-integer "1"
== integer!
John Niclasen
11-Feb-2007 15:28:11
I use context [] in most of my scripts. I haven't thought about it more deeply, than I just use it because it's easy. And I like the concept of a context.
Maxim Olivier-Adlhoch
11-Feb-2007 17:55:10
I used to write make object! [] all the time and then I suddenly switched to context. and have not looked back since. Its just one of those elegance things I think.

In retrospect, I think the word context, should have been object. object [] is just like function [][] (func, does has, etc) and others.

make object! [] looks like a class declaration, obj, is definitely not pretty, and to-object, makes it look like a type conversion... which it isn't in the sence of how its being used. (we aren't converting an integer to an object, for example, to get at the integer accessors).

If you are going to replace context... think about why you added context in the first place. Its just more elegant. make object! [] is still there in any case.

Maxim Olivier-Adlhoch
11-Feb-2007 18:04:39
I think I also use context because it reminds more of how objects work internally, as opposed to other languages... because of how binding occurs and all that.

I think, the use of the word context, keeps that at the top of my mind... and tends to have fledgling REBOLers thinking about such differences. Which is probably why Carl used 'context in the first place...

Volker
11-Feb-2007 20:56:50
My first thought was: instance[]

I like Maxims more: object[]

If we free 'context, maybe that could be used instead of 'module ?

Maxim Olivier-Adlhoch
11-Feb-2007 21:53:18
good one volker... I agree that context would be the more precise term for module... in all of what I have so far anyways.
Maxim Olivier-Adlhoch
11-Feb-2007 21:56:32
oops.... { as in all I have "read" so far }
Anton Rolls
11-Feb-2007 23:51:11
TO-OBJECT is not much shorter than MAKE OBJECT! so the benefit seems small.
OBJ is too abbreviated for me.
OBJECT looks the best of the three,
but it means we can't use OBJECT as a variable - but we have similar problems today and we work around them.
Henrik
12-Feb-2007 2:59:42
I'd have to agree with Anton about OBJECT and variable problems.

I'm not sure it should be named because it's a smaller set of characters to type. I think it should rather be named to be consistent with how other things are MAKE'd, so I'd have to go with TO-OBJECT, although I like INSTANCE.

Goldevil
12-Feb-2007 3:20:18
I vote for OBJECT.

And I also vote for a new functionnality of the Carl's blog engine : a vote system ;-)

Robert
12-Feb-2007 3:40:34
What do we do with CONTEXT than? Just get rid of it? Than I'm against it. Using OBJECT is a big dangerous because it's not in an OO sense... hence I like CONTEXT more.

If we have a different usage for CONTEXT, ok, lets discuss it.

Gabriele
12-Feb-2007 4:49:48
I use CONTEXT all the time. :) I'd be ok with OBJECT, but only if CONTEXT means something else, because otherwise currently objects are the "closest" thing to actual contexts, so it makes sense to consider them being the same (and the differences just being an implementation issue).
DideC
12-Feb-2007 5:47:31
I usually use CONTEXT to create a context ;-) and MAKE OBJECT! to create objects. I know the result is the same, but it's just a manner to distinguish in the source what I want to do !

OBJECT could be fine If I must vote for one.

Dave Cope
12-Feb-2007 7:39:40
I think the word "object" in general is overused in computing to the point of it being meaningless. I like context as I don't think of Rebol as OO. However, I really will like the proposed modularity in Rebol3.

I tend to thing of 'context as a package - the nearest thing to a module that we now have in Rebol. So, I'd like to keep context unless we get true OOP in Rebol.

-pekr-
12-Feb-2007 8:50:17
I like context. I would use context for both objects and modules, as in both cases it creates kind of context - what context, it just depends upon ... well, a context of usage :-)
Paul Tretter
12-Feb-2007 10:16:46
OBJECT (6 letters) context (7 letters) obj (3 letters). I'm in favor of OBJECT because I think "obj" is better left to the programmers discretion.
John Niclasen
12-Feb-2007 10:59:49
Maybe I should specify, how I use CONTEXT. Most of the time, I wrap my scripts in

context [
...
]

Whenever I assign an object to a word, I always use

o: make object! [...]

So I only use CONTEXT, when I wanna hide the interior for global context (global words), and I think, it's good for that, else I use make object! [].

Brian Hawley
12-Feb-2007 14:57:57
Like many here, I also use CONTEXT when I would use a context, and make object! when creating an object. If there were any changes, I would like there to be something better suited to use as a context available, and have CONTEXT make that. If there were an OBJECT wrapper for make object!, I'd probably use that when using REBOL interactively, when every character counts.
Anton Rolls
13-Feb-2007 9:10:03
I agree with Gabriele, DideC, Dave Cope, Brian Hawley.
tomc
14-Feb-2007 20:02:46
only used context[] to try it on and went straight back to make object! [] obj should be left for the programmer to use so object[] is the only rational choice
Gregg Irwin
15-Feb-2007 17:10:17
I'm with Gabriele, DideC, Dave, Brian, and Anton. If it changes, it will also break a lot of my code. If there's a good reason for it, that's fine, but if there isn't a good and compelling reason...

I use 'obj a lot, and it's too short, IMO, so that's right out. I don't care for 'object either. "make object!" isn't all that bad, and I don't think it's something that's used so often that trying to save a keystroke or two is a big deal. What's important to me is the meaning the words convey.

Pier Johnson
19-May-2007 23:24:59
'context' as a word is bad, yet 'object' as a word is far worse.

Neither captures the essense of what's happening with REBOL.

Both shout "yet another also-ran language interpreter glomming off of SIMULA and OBJECT-oriented programming language paradigm."

To become the true rebel, REBOL should leverage words that break from nerdy computer jargon with the goal of appealing to the everday person seeking better ways of messaging.

Better descriptors include:

indexed-block or index-block

set-block

tagged-block or tag-block

jump-block

Pier Johnson
23-May-2007 21:26:51
And while you consider changing words, how about changing these:

set-word! to tag-word!

since that is what it does

tag! to markup!

even backward freaks at W3C refer to tags as "elements" NOT tags.

Post a Comment:

You can post a comment here. Keep it on-topic.

Name:

Blog id:

R3-0059


Comment:


 Note: HTML tags allowed for: b i u li ol ul font span div a p br pre tt blockquote
 
 

This is a technical blog related to the above topic. We reserve the right to remove comments that are off-topic, irrelevant links, advertisements, spams, personal attacks, politics, religion, etc.

REBOL 3.0
Updated 24-Mar-2017 - Edit - Copyright REBOL Technologies - REBOL.net