|
Pages: [1]
|
 |
|
Author
|
Topic: New instead of Make (Read 2680 times)
|
|
Edoc
|
I've written a handful of utilities, each of which have gone over to an outside vendor for usage & maintenance.
In my code reviews with them, I noticed that the usage of the word 'make was perceived as odd to them (if they had ever used Logo, that wouldn't be the case).
input-str: make string! 100
I'll add that the rules of punctuation in general seemed odd to them (e.g., string!, length?, no punc in 'what-dir).
I've rewritten the 'make assignments as follows, since, as minor as this is, it makes more sense to them.
new: :make name: new object! [fname: none lname: none] fella: new name
Strange how coders can get hung up on such a minor thing. Any reason why I should avoid using the word 'new?
|
|
|
|
|
Logged
|
|
|
|
|
GedB
|
Seems to me that its a nice feature of Rebol that you can easily play with the vocabulary like this.
I've no idea why make is used rather than new. Does it really matter?
I've seen programmers do stuff like this, and it always strikes me as a poor cover for there ignorance.
I think if developers could be honest enought to say something like "I am having trouble understanding this unfamiliar syntax" this would be a much nicer field to work in.
|
|
|
|
|
Logged
|
|
|
|
|
Graham
|
My guess would be that 'make is a verb, whereas 'new is not.
|
|
|
|
|
Logged
|
|
|
|
|
DideC
|
In the philosophie of rebol, graham is right : action must be a verb. Other reason could be that 'make act on all datatypes. 'new word looks restricted to object OMO
|
|
|
|
|
Logged
|
|
|
|
|
Gregg
|
If you use NEW this way, just be aware that it is used as a word in VID. i.e. it may cause confusion, or issues, if you write styles and want to use it there.
|
|
|
|
|
Logged
|
|
|
|
|
carloslorenz
|
If you use NEW this way, just be aware that it is used as a word in VID. i.e. it may cause confusion, or issues, if you write styles and want to use it there. Gregg how do you use NEW word in /View ?
|
|
|
|
|
Logged
|
|
|
|
|
Gregg
|
NEW is used inside VID (not View). If you look at the source for a style that uses custom facets (i.e. look in the words: block in the style def), you'll see NEW referenced. It refers to the face that is in the process of being constructed.
|
|
|
|
|
Logged
|
|
|
|
|
Gabriele
|
Gregg, note however that in face/words you have facets and functions; they're usually defined as func [new args] [...] but of course you could use any name.
As has already been said, the reason why "new" is not a good idea is that it is not a verb.
|
|
|
|
|
Logged
|
|
|
|
|
-jn-
|
Please don't! ;-) Having worked with other extensible languages in the past, I strongly recommend that you NOT redefine the commonly-used words of the core language. It doesn't really add any expressive power; more importantly, it means that your subsequent programs are now written in a "private personal language" which someone else will have more trouble reading! You may only be writing REBOL for yourself (for personal projects, education, entertainment, etc.), but as soon as you: [li]need to ask another REBOL programmer for help [li]write something useful that you'd like to share [li]collaborate on a project with other REBOL programmers
you'll have to worry about whether you've used such personal language in your code that the other person won't know (or have the definitions for). In the long run, it's just not worth it. Learning a programming language is just like learning a natural language in the sense that, to do it well, you really need to know and observe the customs, conventions, and idioms of the existing language community, instead of immediately trying to change everyone else's habits. Just my $0.02...
|
|
|
|
|
Logged
|
|
|
|
|
GedB
|
As an asside, I've been reeading Betrand Meyer's OOSC2, which uses his language Eiffel.
In Eiffel make is used instead of new, so it isn't unique to REBOL.
|
|
|
|
|
Logged
|
|
|
|
|
Graham
|
And the venerable and much older language Forth uses create ...
|
|
|
|
|
Logged
|
|
|
|
|
Edoc
|
Good people, thanks to all for the replies.
I will withdraw that superficial construct from the code and tell the developers to "deal with it". It's not a major issue at all, just one that ocurred to me as this Forum was announced.
FYI, I did not redefine the behavior 'make in any way-- as you can tell from the example, I merely assigned an additional word to the value of 'make-- gave it another handle-- a synonym, if you will. 'make would of course be available and continue to function exactly as specified within the core language.
Seems to me that REBOL is designed to permit exactly this sort of (mostly) harmless word-play; some folks might even call it a dialect =^)
JN, I could interpret your argument to be anti-dialects.... not to mention the adoption of new languages (such as REBOL) in general. That's a good-natured troll, of course, so please reply only in "enlightenment mode."
Thanks again.
|
|
|
|
|
Logged
|
|
|
|
|
-jn-
|
Re "anti-dialect" or (anti-new-language), I very specifically limited my comments to *RE*-defining "the commonly-used words of the core language". Creating a dialect (or just defining a function, for that matter) which *adds* functionality not built into the core language, is an entirely different matter (and I agree that being able to do so is one of the nicest aspects of the REBOL language).
FWIW, this is essentially the same issue as in the early days of c when lots of former Pascal programmers wanted to put
#define BEGIN { #define END }
at the beginning of all of their c programs! ;-)
|
|
|
|
|
Logged
|
|
|
|
|
Edoc
|
JN-- Thanks for the clarification. I couldn't resist poking that into the conversation.
REBOL is a language that let's you break so many rules. It often strikes me as funny when people say: "code like this" or "style like that" because REBOL seems to so willfully bend away from convention.
For this reason I often think of REBOL as a personal programming language. It's not really designed for working with teams of programmers and besides, a single programmer can command such a broad perimeter of functionality.
Maybe this says something about REBOL programmers: those who are attracted to it (thus far) are rugged individualists & non-conformists. Perhaps this is why REBOL seems to be a cloistered community.
|
|
|
|
|
Logged
|
|
|
|
|
Gregg
|
For this reason I often think of REBOL as a personal programming language. It's not really designed for working with teams of programmers and besides... I agree, and I disagree. :-) It's definitely a great personal language, but I think--once we get the hang of it--we'll see it used by teams in the same way, bent to their will and style. It's all about communication after all.
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |
News: 01-09-08 Alpha version of REBOL 3 has been released!
2191 Posts in 572 Topics by 1684 Members
Latest Member: CinemeandaBek
|