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

World: r3wp

[!REBOL3]

Ladislav
12-Jan-2011
[6991x6]
this naming convention doesn't work with MAXIMUM-OF and MINIMUM-OF, 
which don't actually return the maximum or minimum of a series, they 
return the series at the position of the maximum or minimum. Gregg 
has suggested that these be renamed to FIND-MAX and FIND-MIN instead, 
and this will probably happen (rarely used, really badly named). 

 - I have got absolutely no problem with MAXIMUM-OF or MINIMUM-OF, 
 FIND-MAX and FIND-MIN aren't any better, because they express the 
 same, just in a less fortunate way (find is less descriptive than 
 maximum/minimum)
To describe something else we would need to use something line INDEX-OF-MAXIMUM?, 
which is more accurate, but unnecessarily long to my taste
It is a good idea to only use noun-of for intrinsic properties, rather 
than contents of container types.

 - it looks to me that you suggest, that for you, the preferable way 
 is:

    faces? face

, and not

    faces-of face


As far as I am concerned, I used the convention as written now, but, 
probably, the majority of users prefer the latter.
(in this specific case)
Or, to be even more accurate with the MAXIMUM-OF replacement, I should 
have mentioned POSITION-OF-MAXIMUM?, which is even longer
I do not think, that the name of a function should describe everything, 
so, if I really want to get the maximal of the values in a series, 
I can be content to know that the MAXIMUM-OF function exists and 
be prepared to read the doc string what it actually does.
ChristianE
12-Jan-2011
[6997]
Aren't those more like AT-MAXIMUM and AT-MINIMUM ?
Ladislav
12-Jan-2011
[6998x3]
that looks more descriptive
you should add it to the above CC ticket as your proposal, I guess
or, if you do not want to, I can do it
ChristianE
12-Jan-2011
[7001]
Done.
BrianH
12-Jan-2011
[7002x5]
Yeah, that "intrinsic properties" is the softest part of the rule, 
and only really applies to core mezzanines. It is a little more accurate 
to say that for the container access functions that are in core, 
which are *all* legacy functions, the -of is implicit. If the alternative 
is putting a ? on the word, definitely use -of instead for new functions 
if they aren't for use in conditional contexts, or in some other 
way are a question.
I'll edit the comment accordingly.
The choice isn't between FACES? and FACES-OF, it's between FACES-OF 
and FACES.
And it wouldn't be INDEX-OF-MAXIMUM?: First of all, the ? is inappropriate, 
secondly, it returns the series, not the index. FIND-MAX isn't less 
descriptive because it references the behavior of MAX (which we have 
already learned means maximum) and FIND (which we know returns the 
argument series at the position of the thing found). We don't only 
get our conceptual context from English, we also get it from the 
rest of REBOL.
ChristianE, AT-MAXIMUM and AT-MINIMUM are much better, I'll relay 
that suggestion.
Cyphre
12-Jan-2011
[7007]
Guys, anyone knows if this was discussed as 'intended behaviour' 
by Carl or looks like inconsistency/bug to you?

>> a: make object! [b: []]
== make object! [
    b: []
]

>> c: make a []
== make object! [
    b: []
]

>> d: make a make object! []
== make object! [
    b: []
]

>> same? a/b c/b
== false

>> same? a/b d/b
== true
Ladislav
12-Jan-2011
[7008]
The choice isn't between FACES? and FACES-OF, it's between FACES-OF 
and FACES.

 - actually, not. The FACES? word is the one used now, which is created 
 in accordance with the current function naming wording, since we 
 defined a function collecting the faces contained in a panel.
Steeve
12-Jan-2011
[7009]
Cyphre, Something never tried before can't be categorized as a bug.
It's a feature :-)
Cyphre
12-Jan-2011
[7010]
well, in R2 'copies' in both cases..so its either intended change 
in R3 or bug
Steeve
12-Jan-2011
[7011x3]
>> d: make a make object! []
same behavior than 
>> d: append make object! [] a

But I agree, it's quite unexpected.
my mistake, same as
>> d: copy a
I vote for inconsistent.
>> make object! object! 
Should that be allowed, to begin with ?
Cyphre
12-Jan-2011
[7014]
It was allowed in R2 so why not?
Steeve
12-Jan-2011
[7015]
Never saw that before. I don't understand the expected behavior to 
begin with.
Cyphre
12-Jan-2011
[7016]
http://www.rebol.com/docs/changes-2-5.html#section-85
Steeve
12-Jan-2011
[7017x2]
Hum ok, it's cleared stated then. It's a feature
*clearly
Cyphre
12-Jan-2011
[7019]
R2 session:
>> a: make object! [b: []]
>> c: make a []
>> d: make a make object! []
>> same? a/b c/b
== false
>> same? a/b d/b
== false


So if this was changed in R3 I'm asking if it was intended or not. 
I don't care much what is the 'right' way but asking mainly because 
if the change was intended it should be well noted and documented 
otherwise it can make headache to people.
Steeve
12-Jan-2011
[7020x2]
OH, I see your point now.

I think it's a bug now, It's doing the reverse of the R2 behavior.
>> d: make a make object! []
R3 reverse the parameters at some point and performs 
>> d: make object! [] a
inconsistent anyway
Cyphre
12-Jan-2011
[7022x2]
the difference I was pointing out is:


make <object> <block> ;copies the block values inside the prototype 
object

while


make <object> <object> ;doesn't copy the block values in prototype 
object
that is in R3...in R2 it was consistent
Steeve
12-Jan-2011
[7024x2]
yeah it's what I understood
In R3 
>> d: make obejct1 object2
should behave like
>> d: append object1 body-of object2

But yeah, the first form is more concise and faster.
Kaj
12-Jan-2011
[7026x5]
Do you know this document?
http://www.rebol.net/w/index.php?title=Copy_Semantics&redirect=no
There was a big discussion before it, so I would guess it's intended, 
although I'm not sure
Maxim should know the details, because he pushed for changes in object 
copying
I think the point was to have programmer control over the copying 
of an object that is being cloned
Maxim
12-Jan-2011
[7031]
yes copy control was implemented because of real world issues trying 
to use early R3 alphas and also because the lack of control in R2 
makes many big data sets very hard to manage in R2.
BrianH
12-Jan-2011
[7032]
Ladislav, FACES? was created in accordance with the current documentation 
of the function naming standards, not the current function naming 
standards. The documentation needs fixing.
Ladislav
12-Jan-2011
[7033x2]
So, could you tell me what your preferences are?
(regarding the wording)
BrianH
12-Jan-2011
[7035]
If it's a function that takes a face or gob as a parameter and returns 
the faces inside of it, I prefer FACES-OF. If it is a member function 
(assigned to a field of a face and bound to it), FACES. Those look 
best to those familiar with English. We're trying to cut down on 
*? for functions that aren't questions or part of the help system.
Ladislav
12-Jan-2011
[7036x2]
I thought, you did not intend to change the wording of of 


http://www.rebol.com/r3/docs/concepts/scripts-style.html#section-11

, did you?
Aha, that "if it is a member function" was what you meant. It is 
not, currently.
BrianH
12-Jan-2011
[7038x2]
If necessary, yes. The noun-OF convention should be added, and some 
sensible *? conventions should be mentioned too. In particular, the 
"is it a question?" criteria is a good thing to mention.
I don't have the time this week to do so, and am waiting on some 
more community understanding before I jump in. The "intrinsic property" 
thing likely won't survuve the cut, being replaced by the "implicit 
-of" thing.
Ladislav
12-Jan-2011
[7040]
But, the 

    Face/faces


was used before the change, and it was not a function, but a block 
"storing" the faces