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

World: r3wp

[!REBOL3]

Kaj
11-Jan-2011
[6965x2]
Yes, so not consistent according to your black and white interpretation
In many cases when you ask a question in human language, you want 
to make a decision. So I associate a question mark in REBOL with 
control flow, and would thus rather limit the ? qualifier to logic 
values
Ladislav
11-Jan-2011
[6967]
that is you speaking about "inconsistency", no problem for me, exactly 
like it is you reinventing non-existent conventions, like non-logic 
versus logic return values
Kaj
11-Jan-2011
[6968]
You're the one who wants to make the convention black and white, 
not me
Ladislav
11-Jan-2011
[6969]
I do want to respect the convention when possible, and, frankly, 
you cannot do anything about my will in that respect
Ashley
11-Jan-2011
[6970]
The current convention works for me, but I don't think of it in verb/noun 
terms but question/non-question terms.


 length? and none? are both questions, whether they return a logic! 
 or not can be deduced by their name(s) ... ("What is the length?" 
 versus "Is this a none value?")

A question must return a logic, none or scalar value.


The best we can say about non-questions is that they generally "do" 
or change something.
BrianH
11-Jan-2011
[6971x7]
Ladislav, I added some comments to http://issue.cc/r3/1818- apparently 
the docs hadn't been updated with the *-OF convention.
Unfortunately (at times) we are still stuck with the legacy name 
rule (with some exceptions for rarely used functions).
We are trying to cut down on the number of *? conventions. Look at 
the comments for details.
The noun-OF convention is usually reserved for intrinsic properties 
rather than contents, at least for the mezzanines, but you might 
consider it for contents in the GUI code if it seems appropriate.
Only modifying or action functions should have verbs, not all functions. 
The *-OF convention comes from English, not C.
This decision came out of the early R3 project a few years ago, back 
when you were still taking a break from REBOL :)
In the case of your faces question, "faces" is a collective noun, 
and in function form is a request for a property or contents of its 
argument (don't know which), so FACES-OF would probably be preferred, 
leaving the 'faces word available to be used as a variable. Or GET-FACES 
if you prefer to emphasize the action of retrieving that value and 
have a corresponding SET-FACES function.
Maxim
11-Jan-2011
[6978]
I added my two cents to the CC discussion.
BrianH
11-Jan-2011
[6979x5]
Look at my reply :)
Some *? functions that might be better off as *-OF: ENCODING?, FILE-TYPE?, 
INDEX?, LENGTH?, SIGN? and SIZE?. Except for the first two the old 
names would need to stick around because of the legacy naming rules. 
Strangely enough, UTF? is OK because it is short for "UTF what?". 
The series contents functions have an implicit -OF :)
INFO? is iffy because "info" is not an adjective and makes a poor 
question word, but it can be used in a conditional context (it returns 
none if there is no info) and the legacy naming rule applies so it's 
probably not worth adding INFO-OF.
I'd be willing to let the series actions that return contents to 
continue to have the -OF be implicit, especially since they are legacy 
:)
And HEAD and TAIL can still have -OF be implicit too, IMO.
Maxim
11-Jan-2011
[6984x4]
I think to,  I think the rule is most usefull in cases like bind 
where we need multiple variants of a word to mean different things. 
  in such a case, the  ? should always tend toward the most obvious/usefull 
conditional safe function.   :-)
(even if it does return a value instead of true)
for example, I feel that binding?  would have been a much better 
word than bind?
since we understand that if something has a value, we might as well 
receive the value instead of just knowing that this is true.
Kaj
11-Jan-2011
[6988]
Sounds excellent, Brian
BrianH
12-Jan-2011
[6989x2]
This is one of those weird circumstances where I know the answer 
to the question because I was there when the original decision was 
made. The reflectors (the *-OF functions that call REFLECT) were 
my idea in the first place, as a security measure, though obviously 
Carl wrote them and came up with the nouns :)
The word "binding" is two different nouns (one referring to the act 
of binding, one referring to the result of binding), so it doesn't 
fit the adjective? model very well. The word "bound" is the adjective 
form. See http://issue.cc/r3/1819for details.
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?