r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3]

Gregg
2-Aug-2010
[4146]
Fork, I won't say you're wrong on names, but you can't be right. 
:-) Naming is subjective, and there is no such thing as intuitive; 
unless you use natural language as the reference.
Fork
2-Aug-2010
[4147]
I like to feel like there's some matter of principle driving why 
the language doesn't define "app" for append or "rev" for reverse 
by default.  So yes, I'd use natural language as the reference in 
this case, but only because it seems like a convention which is *almost* 
followed but with these few exceptions that do not seem necessary.
Gregg
2-Aug-2010
[4148]
REBOL is not about being as terse as possible. That's for Perl and 
Rebmu. I don't agree with all the designer's choices, but I can at 
least understand most of them. We all have things we don't like, 
and those things are different for each of us.
Fork
2-Aug-2010
[4149]
I feel like it's almost possible to teach people non-idiomatic Rebol 
and have it make sense from the get-go, where you can really focus 
on the code.  There are ways to keep from triggering "WTF" responses, 
like putting in parentheses when they're not strictly necessary. 
 And it seems so close that it's a shame the last little bit isn't 
done.
Gregg
2-Aug-2010
[4150]
The catch is that "the last little bit" is not little at all. It's 
fundamental. I know you know that, but if we change REBOL to work 
like C and PHP people expect, that's what it will be.
Maxim
2-Aug-2010
[4151x2]
experienced programmers have learnt to accept idioms like the requirement 
of parens on function calls.


they have to understand a different set of idioms.  "unlearning" 
that some of what they perceive as "fundamental" in programming is 
hard.


new programmers will have it the other way round if they learn REBOL 
first... why do we needs comas, and parens everywhere.... seems like 
waste.
where are refinements, things like that.
Fork
2-Aug-2010
[4153]
Depending on how you are presented with something, the "unlearning" 
can be either a joy or a suffering.  Put a kid on a bicycle with 
no training wheels and they fall and get hurt and they might not 
appreciate bicycles very much.  Give them some training wheels and 
let them get comfortable and be happy the day it comes off.
Maxim
2-Aug-2010
[4154x2]
yes, but its still a bicycle. start them of on a tricycle and none 
of what they learned there it is usefull.  on a tricycle, if you 
lean you fall. on a bike, if you don't lean you fall.
(to an extent, obviously)
Gregg
2-Aug-2010
[4156]
Maybe this should move to advocacy.
Maxim
2-Aug-2010
[4157]
yeah, I just realized we wheren't there... but this tangent is somewhat 
exhausted ;-)

we need 'FUNCTOR   ;-)
Ladislav
2-Aug-2010
[4158x2]
Since I was unable to get an answer to my question:


I want to ask you a question related to your refinement-arguments 

initialization" (actually, it is not initialization, but "unused 
refinement arguments", like the /local arguments are usually preferences 
(see the wording of my answers at http://stackoverflow.com/questions/3168226/how-value-function-really-works
)"


from RebolTutorial messing the thing up with a purported incompatibility 
between FUNCT and FUNC, I guess, that this is the place where the 
question would be at least understood. So, is there anybody actually 
preferring the "unused refinement arguments" to be unset, than to 
be set to #[none] at every function call?
oh, sorry for the above mess, it is totally unreadable, as it looks
Maxim
2-Aug-2010
[4160x3]
THEY HAVE TO BE NONE!
so many coding patterns depend on it.
that is for 'FUNC.  


not shure what the difference is with FUNCT, but I'd prefer them 
to be none there too, though I'm not currently "schooled" as to the 
intricacies of 'FUNCT and what effects any change would have.
Ladislav
2-Aug-2010
[4163x3]
No difference with FUNCT, stop that
OK, I understand, that your preferences are to set these arguments 
to #[none]
so many coding patterns depend on it
 - is that a general sentiment here?
Maxim
2-Aug-2010
[4166]
I have a counter question.  why would be set them to unset!  ?
Ladislav
2-Aug-2010
[4167x3]
Because they are, in fact, "undefined", which, by convention, is 
commonly expressed by having such variables unset in other cases
Even in functions, undefined arguments are in other cases unset, 
not set to #[none]
(I guess, that you know examples for that)
Maxim
2-Aug-2010
[4170x2]
in R2 everything is set to none, not sure about R3.
though I (and many others) often use none, to indicate the use of 
a default or fallback value.
Ladislav
2-Aug-2010
[4172]
R2 example (you surprised me not knowing it):

>> f: func [x [any-type!]] [value? 'x]
>> f
== false
Maxim
2-Aug-2010
[4173x2]
ah, but here you actually supplied unset to the function.

in a way, its not the same as not specifying the /refinement.
but yes, the line is thin.
Ladislav
2-Aug-2010
[4175x2]
>> g: func [/local x [any-type!]] [value? 'x]
>> g
== true
>> g/local
== false
(R2 example too)
Maxim
2-Aug-2010
[4177x2]
but the use of  any-type! is what specifically allows this "trick".

R3 removed the ability to not supply arguments...

>> a: func [x [any-type!]][value? 'x]
>> a
** Script error: a is missing its x argument
IIRC this was the great "equalizer" when make was overhauled... it 
now always accepts exactly one argument, because it is forced to.
Gregg
2-Aug-2010
[4179]
R2's behavior has always worked well for me. Unset is the special 
case I avoid unless I really, REALLY think there's a need to leverage 
it. I very rarely use any-type! for that reason. I like declared 
locals being NONE. I can't think of a time I tripped over using a 
refinement without passing its arg, but there unset would have to 
be intentionally expected as well.
Ladislav
2-Aug-2010
[4180x3]
>> b: func ['x [any-type!]][value? 'x]
>> b
== false
(R3)
Well, anyway, because of this, RebolTutorial completely ignoring 
any explanation makes a bad publicity to Rebol stating that "FUNCT 
and FUNC are incompatible", which is just nonsense.
Maxim
2-Aug-2010
[4183]
ok, but that is a fringe case which probably got put there specifically 
to allow that specific pattern so that some command-line functions 
can be simplied... 
its not the intended use of Rebol.


argument passing by reference is rarely used (a few mezzanines and 
highly specialized situations)
Gregg
2-Aug-2010
[4184]
Agreed. And things like the R3 behavior for a missing arg when using 
a lit-word! param versus a word! param would be good to note in the 
FUNC docs.
Maxim
2-Aug-2010
[4185x2]
in the above cases, they should be unset, because in fact they are 
passed unset!
the 'x refers to no value
Gregg
2-Aug-2010
[4187]
I think Ladislav dislikes lit-word params anyway, as they are a pain 
when generating code, but they make for good examples and thought 
experiments.
Maxim
2-Aug-2010
[4188]
they are mainly used for command-lines and code analysis funcs (?? 
for example)
Ladislav
2-Aug-2010
[4189]
Explanation: the "partially evaluated arguments" as used in R3 are 
OK with me, I disliked their R2 counterparts.
Gregg
2-Aug-2010
[4190]
OK. :-)
Maxim
2-Aug-2010
[4191x2]
yes, I agree completely.  this is now an intended setup, not an interpreter 
loophole leveraged as a feature.
Lad, can you explain simply, what is the difference between func 
and funct which RebolTutorial claims?
Ladislav
2-Aug-2010
[4193]
I cannot, because there is none
Maxim
2-Aug-2010
[4194]
ok
Ladislav
2-Aug-2010
[4195]
Example: