I have a dream... or why I think that compatibility is an illusion and bring us to the past
I would love to retract ? and ! from the list of binary selectors. Iâm super super frustrated that predicates cannot be easily identifiable. for example is lineUpBlockBrackets an action or a testing method. I think that we are trapped in mistakes from the past. In racket and scheme and I guess ruby too we can use ? in the method and this change the game. self lineUpBlockBrackets? We have plenty of binary selector parts that are not used and think that it is frustrating. Let us check: Character specialCharacters '+-/\*~<>=@,%|&?!·÷±Ã' + - / \ ~ <
= @ , & | % those are ok I have no idea what is · nor how to type it. ÷ looks from the past. ± so funny à no idea what it is andâ¦. Then we have two that could really improve our language ? and ! Do not tell me that there is a value in these selectors? (#(#+ #- #/ #\ #* #~ #< #> #= #@ #, #% #| #& #? #!) combinations select: [ :each | each size = 3 and: [ each includesAnyOf: #(#? #!) ] ]) collect: [ :each | each first, each second, each third ] #(#'+-?' #'+-!' #'+/?' #'+/!' #'+\?' #'+\!' #'+*?' #'+*!' #'+~?' #'+~!' #'+<?' #'+<!' #'+>?' #'+>!' #'+=?' #'+=!' #'+@?' #'+@!' #'+,?' #'+,!' #'+%?' #'+%!' #'+|?' #'+|!' #'+&?' #'+&!' #'+?!' #'-/?' #'-/!' #'-\?' #'-\!' #'-*?' #'-*!' #'-~?' #'-~!' #'-<?' #'-<!' #'->?' #'->!' #'-=?' #'-=!' #'-@?' #'-@!' #'-,?' #'-,!' #'-%?' #'-%!' #'-|?' #'-|!' #'-&?' #'-&!' #'-?!' #'/\?' #'/\!' #'/*?' #'/*!' #'/~?' #'/~!' #'/<?' #'/<!' #'/>?' #'/>!' #'/=?' #'/=!' #'/@?' #'/@!' #'/,?' #'/,!' #'/%?' #'/%!' #'/|?' #'/|!' #'/&?' #'/&!' #'/?!' #'\*?' #'\*!' #'\~?' #'\~!' #'\<?' #'\<!' #'\>?' #'\>!' #'\=?' #'\=!' #'\@?' #'\@!' #'\,?' #'\,!' #'\%?' #'\%!' #'\|?' #'\|!' #'\&?' #'\&!' #'\?!' #'*~?' #'*~!' #'*<?' #'*<!' #'*>?' #'*>!' #'*=?' #'*=!' #'*@?' #'*@!' #'*,?' #'*,!' #'*%?' #'*%!' #'*|?' #'*|!' #'*&?' #'*&!' #'*?!' #'~<?' #'~<!' #'~>?' #'~>!' #'~=?' #'~=!' #'~@?' #'~@!' #'~,?' #'~,!' #'~%?' #'~%!' #'~|?' #'~|!' #'~&?' #'~&!' #'~?!' #'<>?' #'<>!' #'<=?' #'<=!' #'<@?' #'<@!' #'<,?' #'<,!' #'<%?' #'<%!' #'<|?' #'<|!' #'<&?' #'<&!' #'<?!' #'>=?' #'>=!' #'>@?' #'>@!' #'>,?' #'>,!' #'>%?' #'>%!' #'>|?' #'>|!' #'>&?' #'>&!' #'>?!' #'=@?' #'=@!' #'=,?' #'=,!' #'=%?' #'=%!' #'=|?' #'=|!' #'=&?' #'=&!' #'=?!' #'@,?' #'@,!' #'@%?' #'@%!' #'@|?' #'@|!' #'@&?' #'@&!' #'@?!' #',%?' #',%!' #',|?' #',|!' #',&?' #',&!' #',?!' #'%|?' #'%|!' #'%&?' #'%&!' #'%?!' #'|&?' #'|&!' #'|?!' #'&?!â) may be this one #&?! is useful for WTF! And because of that we sacrifice having nice method names! I really think that we should change that. S.
Yes, it would. On Tue, Sep 10, 2019 at 10:55 PM Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 10 Sep 2019, at 22:14, ducasse <stepharo@netcourrier.com> wrote:
Then we have two that could really improve our language ? and !
I never thought about that, but indeed, that would be quite nice.
Looks like Christmas season opened early this year :) Jokes aside, I'm in favor of changing some of the characters we use for binary selectors to allow it to be used in keyword/unary messages. I'll include % in that list. For me its more useful as a way to create percentages ( 5 % ) than to be used as a binary message for keeping an ugly name from C-like languages. - · is middle dot and it's used in some math operations AFAIR - à is used in math also (it's used as the multiplication sign for scalars, cross product for vectors and cartesian product for sets) One thing that would be really cool is that we can use the full power of Unicode in methods/class names. Projects like polymath and DSLs can clearly take advantage of that. Some examples I've just invented, but can be supported: - â from: 1 to: 5 do: [:i | i + i squared ] - 1 ⥠3 - â anyIn: #( 1 2 4) such: [:x | x isPrime ] - â includes: 1 On Tue, Sep 10, 2019 at 5:15 PM ducasse <stepharo@netcourrier.com> wrote:
I would love to retract ? and ! from the list of binary selectors. Iâm super super frustrated that predicates cannot be easily identifiable.
for example is lineUpBlockBrackets an action or a testing method.
I think that we are trapped in mistakes from the past. In racket and scheme and I guess ruby too we can use ? in the method and this change the game.
self lineUpBlockBrackets?
We have plenty of binary selector parts that are not used and think that it is frustrating.
Let us check:
Character specialCharacters
'+-/\*~<>=@,%|&?!·÷±Ã'
+ - / \ ~ <
= @ , & | %
those are ok
I have no idea what is · nor how to type it. ÷ looks from the past. ± so funny à no idea what it is andâ¦.
Then we have two that could really improve our language ? and !
Do not tell me that there is a value in these selectors?
(#(#+ #- #/ #\ #* #~ #< #> #= #@ #, #% #| #& #? #!) combinations select: [ :each | each size = 3 and: [ each includesAnyOf: #(#? #!) ] ]) collect: [ :each | each first, each second, each third ]
#(#'+-?' #'+-!' #'+/?' #'+/!' #'+\?' #'+\!' #'+*?' #'+*!' #'+~?' #'+~!' #'+<?' #'+<!' #'+>?' #'+>!' #'+=?' #'+=!' #'+@?' #'+@!' #'+,?' #'+,!' #'+%?' #'+%!' #'+|?' #'+|!' #'+&?' #'+&!' #'+?!' #'-/?' #'-/!' #'-\?' #'-\!' #'-*?' #'-*!' #'-~?' #'-~!' #'-<?' #'-<!' #'->?' #'->!' #'-=?' #'-=!' #'-@?' #'-@!' #'-,?' #'-,!' #'-%?' #'-%!' #'-|?' #'-|!' #'-&?' #'-&!' #'-?!' #'/\?' #'/\!' #'/*?' #'/*!' #'/~?' #'/~!' #'/<?' #'/<!' #'/>?' #'/>!' #'/=?' #'/=!' #'/@?' #'/@!' #'/,?' #'/,!' #'/%?' #'/%!' #'/|?' #'/|!' #'/&?' #'/&!' #'/?!' #'\*?' #'\*!' #'\~?' #'\~!' #'\<?' #'\<!' #'\>?' #'\>!' #'\=?' #'\=!' #'\@?' #'\@!' #'\,?' #'\,!' #'\%?' #'\%!' #'\|?' #'\|!' #'\&?' #'\&!' #'\?!' #'*~?' #'*~!' #'*<?' #'*<!' #'*>?' #'*>!' #'*=?' #'*=!' #'*@?' #'*@!' #'*,?' #'*,!' #'*%?' #'*%!' #'*|?' #'*|!' #'*&?' #'*&!' #'*?!' #'~<?' #'~<!' #'~>?' #'~>!' #'~=?' #'~=!' #'~@?' #'~@!' #'~,?' #'~,!' #'~%?' #'~%!' #'~|?' #'~|!' #'~&?' #'~&!' #'~?!' #'<>?' #'<>!' #'<=?' #'<=!' #'<@?' #'<@!' #'<,?' #'<,!' #'<%?' #'<%!' #'<|?' #'<|!' #'<&?' #'<&!' #'<?!' #'>=?' #'>=!' #'>@?' #'>@!' #'>,?' #'>,!' #'>%?' #'>%!' #'>|?' #'>|!' #'>&?' #'>&!' #'>?!' #'=@?' #'=@!' #'=,?' #'=,!' #'=%?' #'=%!' #'=|?' #'=|!' #'=&?' #'=&!' #'=?!' #'@,?' #'@,!' #'@%?' #'@%!' #'@|?' #'@|!' #'@&?' #'@&!' #'@?!' #',%?' #',%!' #',|?' #',|!' #',&?' #',&!' #',?!' #'%|?' #'%|!' #'%&?' #'%&!' #'%?!' #'|&?' #'|&!' #'|?!' #'&?!â)
may be this one #&?! is useful for WTF!
And because of that we sacrifice having nice method names! I really think that we should change that.
S.
I feel an APL forcefield growing. Phil On Wed, Sep 11, 2019, 02:14 Gabriel Cotelli <g.cotelli@gmail.com> wrote:
Looks like Christmas season opened early this year :)
Jokes aside, I'm in favor of changing some of the characters we use for binary selectors to allow it to be used in keyword/unary messages.
I'll include % in that list. For me its more useful as a way to create percentages ( 5 % ) than to be used as a binary message for keeping an ugly name from C-like languages.
- · is middle dot and it's used in some math operations AFAIR - à is used in math also (it's used as the multiplication sign for scalars, cross product for vectors and cartesian product for sets)
One thing that would be really cool is that we can use the full power of Unicode in methods/class names. Projects like polymath and DSLs can clearly take advantage of that. Some examples I've just invented, but can be supported:
-
â from: 1 to: 5 do: [:i | i + i squared ] -
1 ⥠3 -
â anyIn: #( 1 2 4) such: [:x | x isPrime ] -
â includes: 1
On Tue, Sep 10, 2019 at 5:15 PM ducasse <stepharo@netcourrier.com> wrote:
I would love to retract ? and ! from the list of binary selectors. Iâm super super frustrated that predicates cannot be easily identifiable.
for example is lineUpBlockBrackets an action or a testing method.
I think that we are trapped in mistakes from the past. In racket and scheme and I guess ruby too we can use ? in the method and this change the game.
self lineUpBlockBrackets?
We have plenty of binary selector parts that are not used and think that it is frustrating.
Let us check:
Character specialCharacters
'+-/\*~<>=@,%|&?!·÷±Ã'
+ - / \ ~ <
= @ , & | %
those are ok
I have no idea what is · nor how to type it. ÷ looks from the past. ± so funny à no idea what it is andâ¦.
Then we have two that could really improve our language ? and !
Do not tell me that there is a value in these selectors?
(#(#+ #- #/ #\ #* #~ #< #> #= #@ #, #% #| #& #? #!) combinations select: [ :each | each size = 3 and: [ each includesAnyOf: #(#? #!) ] ]) collect: [ :each | each first, each second, each third ]
#(#'+-?' #'+-!' #'+/?' #'+/!' #'+\?' #'+\!' #'+*?' #'+*!' #'+~?' #'+~!' #'+<?' #'+<!' #'+>?' #'+>!' #'+=?' #'+=!' #'+@?' #'+@!' #'+,?' #'+,!' #'+%?' #'+%!' #'+|?' #'+|!' #'+&?' #'+&!' #'+?!' #'-/?' #'-/!' #'-\?' #'-\!' #'-*?' #'-*!' #'-~?' #'-~!' #'-<?' #'-<!' #'->?' #'->!' #'-=?' #'-=!' #'-@?' #'-@!' #'-,?' #'-,!' #'-%?' #'-%!' #'-|?' #'-|!' #'-&?' #'-&!' #'-?!' #'/\?' #'/\!' #'/*?' #'/*!' #'/~?' #'/~!' #'/<?' #'/<!' #'/>?' #'/>!' #'/=?' #'/=!' #'/@?' #'/@!' #'/,?' #'/,!' #'/%?' #'/%!' #'/|?' #'/|!' #'/&?' #'/&!' #'/?!' #'\*?' #'\*!' #'\~?' #'\~!' #'\<?' #'\<!' #'\>?' #'\>!' #'\=?' #'\=!' #'\@?' #'\@!' #'\,?' #'\,!' #'\%?' #'\%!' #'\|?' #'\|!' #'\&?' #'\&!' #'\?!' #'*~?' #'*~!' #'*<?' #'*<!' #'*>?' #'*>!' #'*=?' #'*=!' #'*@?' #'*@!' #'*,?' #'*,!' #'*%?' #'*%!' #'*|?' #'*|!' #'*&?' #'*&!' #'*?!' #'~<?' #'~<!' #'~>?' #'~>!' #'~=?' #'~=!' #'~@?' #'~@!' #'~,?' #'~,!' #'~%?' #'~%!' #'~|?' #'~|!' #'~&?' #'~&!' #'~?!' #'<>?' #'<>!' #'<=?' #'<=!' #'<@?' #'<@!' #'<,?' #'<,!' #'<%?' #'<%!' #'<|?' #'<|!' #'<&?' #'<&!' #'<?!' #'>=?' #'>=!' #'>@?' #'>@!' #'>,?' #'>,!' #'>%?' #'>%!' #'>|?' #'>|!' #'>&?' #'>&!' #'>?!' #'=@?' #'=@!' #'=,?' #'=,!' #'=%?' #'=%!' #'=|?' #'=|!' #'=&?' #'=&!' #'=?!' #'@,?' #'@,!' #'@%?' #'@%!' #'@|?' #'@|!' #'@&?' #'@&!' #'@?!' #',%?' #',%!' #',|?' #',|!' #',&?' #',&!' #',?!' #'%|?' #'%|!' #'%&?' #'%&!' #'%?!' #'|&?' #'|&!' #'|?!' #'&?!â)
may be this one #&?! is useful for WTF!
And because of that we sacrifice having nice method names! I really think that we should change that.
S.
sorry, how do you type unicode characters? On Wed, Sep 11, 2019 at 1:07 AM phil@highoctane.be <phil@highoctane.be> wrote:
I feel an APL forcefield growing.
Phil
On Wed, Sep 11, 2019, 02:14 Gabriel Cotelli <g.cotelli@gmail.com> wrote:
Looks like Christmas season opened early this year :)
Jokes aside, I'm in favor of changing some of the characters we use for binary selectors to allow it to be used in keyword/unary messages.
I'll include % in that list. For me its more useful as a way to create percentages ( 5 % ) than to be used as a binary message for keeping an ugly name from C-like languages.
- · is middle dot and it's used in some math operations AFAIR - à is used in math also (it's used as the multiplication sign for scalars, cross product for vectors and cartesian product for sets)
One thing that would be really cool is that we can use the full power of Unicode in methods/class names. Projects like polymath and DSLs can clearly take advantage of that. Some examples I've just invented, but can be supported:
-
â from: 1 to: 5 do: [:i | i + i squared ] -
1 ⥠3 -
â anyIn: #( 1 2 4) such: [:x | x isPrime ] -
â includes: 1
On Tue, Sep 10, 2019 at 5:15 PM ducasse <stepharo@netcourrier.com> wrote:
I would love to retract ? and ! from the list of binary selectors. Iâm super super frustrated that predicates cannot be easily identifiable.
for example is lineUpBlockBrackets an action or a testing method.
I think that we are trapped in mistakes from the past. In racket and scheme and I guess ruby too we can use ? in the method and this change the game.
self lineUpBlockBrackets?
We have plenty of binary selector parts that are not used and think that it is frustrating.
Let us check:
Character specialCharacters
'+-/\*~<>=@,%|&?!·÷±Ã'
+ - / \ ~ <
= @ , & | %
those are ok
I have no idea what is · nor how to type it. ÷ looks from the past. ± so funny à no idea what it is andâ¦.
Then we have two that could really improve our language ? and !
Do not tell me that there is a value in these selectors?
(#(#+ #- #/ #\ #* #~ #< #> #= #@ #, #% #| #& #? #!) combinations select: [ :each | each size = 3 and: [ each includesAnyOf: #(#? #!) ] ]) collect: [ :each | each first, each second, each third ]
#(#'+-?' #'+-!' #'+/?' #'+/!' #'+\?' #'+\!' #'+*?' #'+*!' #'+~?' #'+~!' #'+<?' #'+<!' #'+>?' #'+>!' #'+=?' #'+=!' #'+@?' #'+@!' #'+,?' #'+,!' #'+%?' #'+%!' #'+|?' #'+|!' #'+&?' #'+&!' #'+?!' #'-/?' #'-/!' #'-\?' #'-\!' #'-*?' #'-*!' #'-~?' #'-~!' #'-<?' #'-<!' #'->?' #'->!' #'-=?' #'-=!' #'-@?' #'-@!' #'-,?' #'-,!' #'-%?' #'-%!' #'-|?' #'-|!' #'-&?' #'-&!' #'-?!' #'/\?' #'/\!' #'/*?' #'/*!' #'/~?' #'/~!' #'/<?' #'/<!' #'/>?' #'/>!' #'/=?' #'/=!' #'/@?' #'/@!' #'/,?' #'/,!' #'/%?' #'/%!' #'/|?' #'/|!' #'/&?' #'/&!' #'/?!' #'\*?' #'\*!' #'\~?' #'\~!' #'\<?' #'\<!' #'\>?' #'\>!' #'\=?' #'\=!' #'\@?' #'\@!' #'\,?' #'\,!' #'\%?' #'\%!' #'\|?' #'\|!' #'\&?' #'\&!' #'\?!' #'*~?' #'*~!' #'*<?' #'*<!' #'*>?' #'*>!' #'*=?' #'*=!' #'*@?' #'*@!' #'*,?' #'*,!' #'*%?' #'*%!' #'*|?' #'*|!' #'*&?' #'*&!' #'*?!' #'~<?' #'~<!' #'~>?' #'~>!' #'~=?' #'~=!' #'~@?' #'~@!' #'~,?' #'~,!' #'~%?' #'~%!' #'~|?' #'~|!' #'~&?' #'~&!' #'~?!' #'<>?' #'<>!' #'<=?' #'<=!' #'<@?' #'<@!' #'<,?' #'<,!' #'<%?' #'<%!' #'<|?' #'<|!' #'<&?' #'<&!' #'<?!' #'>=?' #'>=!' #'>@?' #'>@!' #'>,?' #'>,!' #'>%?' #'>%!' #'>|?' #'>|!' #'>&?' #'>&!' #'>?!' #'=@?' #'=@!' #'=,?' #'=,!' #'=%?' #'=%!' #'=|?' #'=|!' #'=&?' #'=&!' #'=?!' #'@,?' #'@,!' #'@%?' #'@%!' #'@|?' #'@|!' #'@&?' #'@&!' #'@?!' #',%?' #',%!' #',|?' #',|!' #',&?' #',&!' #',?!' #'%|?' #'%|!' #'%&?' #'%&!' #'%?!' #'|&?' #'|&!' #'|?!' #'&?!â)
may be this one #&?! is useful for WTF!
And because of that we sacrifice having nice method names! I really think that we should change that.
S.
-- Bernardo E.C. Sent from a cheap desktop computer in South America.
On 11 Sep 2019, at 02:13, Gabriel Cotelli <g.cotelli@gmail.com> wrote:
Looks like Christmas season opened early this year :)
Jokes aside, I'm in favor of changing some of the characters we use for binary selectors to allow it to be used in keyword/unary messages.
I'll include % in that list. For me its more useful as a way to create percentages ( 5 % ) than to be used as a binary message for keeping an ugly name from C-like languages.
Can you explain? Because I thought that % was used and right now it is a binary selector so I would not change it.
· is middle dot and it's used in some math operations AFAIR à is used in math also (it's used as the multiplication sign for scalars, cross product for vectors and cartesian product for sets) Yes I know. We can let them rot in peace.
One thing that would be really cool is that we can use the full power of Unicode in methods/class names. Projects like polymath and DSLs can clearly take advantage of that. Some examples I've just invented, but can be supported:
â from: 1 to: 5 do: [:i | i + i squared ] 1 ⥠3 â anyIn: #( 1 2 4) such: [:x | x isPrime ] â includes: 1
:) Why not :) For me the first step is to be able to rescue ? and ! from decay and give us a MUCH better way to convey meaning. Just for the fun look at the method of the BIContext to see what I mean. Iâm refactoring the API of the new formatter and it is so frustrating to not being able to express interrogation nicely.
On Tue, Sep 10, 2019 at 5:15 PM ducasse <stepharo@netcourrier.com <mailto:stepharo@netcourrier.com>> wrote: I would love to retract ? and ! from the list of binary selectors. Iâm super super frustrated that predicates cannot be easily identifiable.
for example is lineUpBlockBrackets an action or a testing method.
I think that we are trapped in mistakes from the past. In racket and scheme and I guess ruby too we can use ? in the method and this change the game.
self lineUpBlockBrackets?
We have plenty of binary selector parts that are not used and think that it is frustrating.
Let us check:
Character specialCharacters
'+-/\*~<>=@,%|&?!·÷±Ã'
+ - / \ ~ <
= @ , & | %
those are ok
I have no idea what is · nor how to type it. ÷ looks from the past. ± so funny à no idea what it is andâ¦.
Then we have two that could really improve our language ? and !
Do not tell me that there is a value in these selectors?
(#(#+ #- #/ #\ #* #~ #< #> #= #@ #, #% #| #& #? #!) combinations select: [ :each | each size = 3 and: [ each includesAnyOf: #(#? #!) ] ]) collect: [ :each | each first, each second, each third ]
#(#'+-?' #'+-!' #'+/?' #'+/!' #'+\?' #'+\!' #'+*?' #'+*!' #'+~?' #'+~!' #'+<?' #'+<!' #'+>?' #'+>!' #'+=?' #'+=!' #'+@?' #'+@!' #'+,?' #'+,!' #'+%?' #'+%!' #'+|?' #'+|!' #'+&?' #'+&!' #'+?!' #'-/?' #'-/!' #'-\?' #'-\!' #'-*?' #'-*!' #'-~?' #'-~!' #'-<?' #'-<!' #'->?' #'->!' #'-=?' #'-=!' #'-@?' #'-@!' #'-,?' #'-,!' #'-%?' #'-%!' #'-|?' #'-|!' #'-&?' #'-&!' #'-?!' #'/\?' #'/\!' #'/*?' #'/*!' #'/~?' #'/~!' #'/<?' #'/<!' #'/>?' #'/>!' #'/=?' #'/=!' #'/@?' #'/@!' #'/,?' #'/,!' #'/%?' #'/%!' #'/|?' #'/|!' #'/&?' #'/&!' #'/?!' #'\*?' #'\*!' #'\~?' #'\~!' #'\<?' #'\<!' #'\>?' #'\>!' #'\=?' #'\=!' #'\@?' #'\@!' #'\,?' #'\,!' #'\%?' #'\%!' #'\|?' #'\|!' #'\&?' #'\&!' #'\?!' #'*~?' #'*~!' #'*<?' #'*<!' #'*>?' #'*>!' #'*=?' #'*=!' #'*@?' #'*@!' #'*,?' #'*,!' #'*%?' #'*%!' #'*|?' #'*|!' #'*&?' #'*&!' #'*?!' #'~<?' #'~<!' #'~>?' #'~>!' #'~=?' #'~=!' #'~@?' #'~@!' #'~,?' #'~,!' #'~%?' #'~%!' #'~|?' #'~|!' #'~&?' #'~&!' #'~?!' #'<>?' #'<>!' #'<=?' #'<=!' #'<@?' #'<@!' #'<,?' #'<,!' #'<%?' #'<%!' #'<|?' #'<|!' #'<&?' #'<&!' #'<?!' #'>=?' #'>=!' #'>@?' #'>@!' #'>,?' #'>,!' #'>%?' #'>%!' #'>|?' #'>|!' #'>&?' #'>&!' #'>?!' #'=@?' #'=@!' #'=,?' #'=,!' #'=%?' #'=%!' #'=|?' #'=|!' #'=&?' #'=&!' #'=?!' #'@,?' #'@,!' #'@%?' #'@%!' #'@|?' #'@|!' #'@&?' #'@&!' #'@?!' #',%?' #',%!' #',|?' #',|!' #',&?' #',&!' #',?!' #'%|?' #'%|!' #'%&?' #'%&!' #'%?!' #'|&?' #'|&!' #'|?!' #'&?!â)
may be this one #&?! is useful for WTF!
And because of that we sacrifice having nice method names! I really think that we should change that.
S.
On Wed, Sep 11, 2019 at 2:14 AM Gabriel Cotelli <g.cotelli@gmail.com> wrote:
Looks like Christmas season opened early this year :)
Jokes aside, I'm in favor of changing some of the characters we use for binary selectors to allow it to be used in keyword/unary messages.
I'll include % in that list. For me its more useful as a way to create percentages ( 5 % ) than to be used as a binary message for keeping an ugly name from C-like languages.
- · is middle dot and it's used in some math operations AFAIR - à is used in math also (it's used as the multiplication sign for scalars, cross product for vectors and cartesian product for sets)
One thing that would be really cool is that we can use the full power of Unicode in methods/class names. Projects like polymath and DSLs can clearly take advantage of that. Some examples I've just invented, but can be supported:
-
â from: 1 to: 5 do: [:i | i + i squared ] -
1 ⥠3 -
â anyIn: #( 1 2 4) such: [:x | x isPrime ] -
â includes: 1
Yes I would like to have something like that for PolyMath :-) Is it possible to use Unicode characters for identifiers already ? I working on the port of : https://github.com/len/Domains to Pharo. The author modify the Cuis parser, so he can do things like that : "â is used for direct sums, â for tensor products, à for cartesian product, direct product of groups, ring products, and in general for categorical products." and also define ^ as a binary method: "The ^ (hat) operator is used for exponentiation as well as conjugation by group elements, and for creating free modules of tuples and matrices." I'm not sure this is a good idea, because ^ is used also to return values. A+ -- Serge Stinckwic h Int. Research Unit on Modelling/Simulation of Complex Systems (UMMISCO) Sorbonne University (SU) French National Research Institute for Sustainable Development (IRD) U niversity of Yaoundé I, Cameroon "Programs must be written for people to read, and only incidentally for machines to execute." https://twitter.com/SergeStinckwich
Le mer. 11 sept. 2019 à 10:40, Serge Stinckwich <serge.stinckwich@gmail.com> a écrit :
On Wed, Sep 11, 2019 at 2:14 AM Gabriel Cotelli <g.cotelli@gmail.com> wrote:
Looks like Christmas season opened early this year :)
Jokes aside, I'm in favor of changing some of the characters we use for binary selectors to allow it to be used in keyword/unary messages.
I'll include % in that list. For me its more useful as a way to create percentages ( 5 % ) than to be used as a binary message for keeping an ugly name from C-like languages.
- · is middle dot and it's used in some math operations AFAIR - à is used in math also (it's used as the multiplication sign for scalars, cross product for vectors and cartesian product for sets)
One thing that would be really cool is that we can use the full power of Unicode in methods/class names. Projects like polymath and DSLs can clearly take advantage of that. Some examples I've just invented, but can be supported:
-
â from: 1 to: 5 do: [:i | i + i squared ] -
1 ⥠3 -
â anyIn: #( 1 2 4) such: [:x | x isPrime ] -
â includes: 1
Yes I would like to have something like that for PolyMath :-) Is it possible to use Unicode characters for identifiers already ?
I working on the port of : https://github.com/len/Domains to Pharo. The author modify the Cuis parser, so he can do things like that :
"â is used for direct sums, â for tensor products, Ã for cartesian product, direct product of groups, ring products, and in general for categorical products."
Of course we want to be able to use those selectors: â â etc... Not using those selectors in core image is one thing, forbiding their usage for every package is another thing Concerning the selectors with more than 2 characters, there are two examples in use in Squeak ==> logical implication (I use it a lot when writing tests cases) <=> space ship operator /// has been used in the past (but is rather deprecated) What is questionable is cultural acceptance of universal meaning of a Symbol <=> could have meant logical equivalence, but it would be pointless, because = (and == thanks to singleton) are already equivalence. It has been expunged from Pharo to my regrets, because it is - beautifully self defined as < = > - culturally legitimate - the art of original author (Travis Griggs) There is no sacred cow, but respect of author has a value for me. It's sure that every binary selector might be questionable, at least in core image. For application, you never know (think DSL) we can create a lot of not completely inaesthetic ASCII styles <|> >< <+> <-> /+/ |*| For example +/- could be used for interval arithmetic (if we don't want to pay the burden of typing unicode, which ain't easy) /\ \/ intersection and union |\| the Nicolas operator - I didn't fin a usage for it yet ;) etc... So why would one want to forbid them? For ? and ! I do not foresee elegant usage as binary, but would not miss them as regular letters eithers. It means accepting huge??? - understand isReallyHuge :) huge?:or!:???and: which are not less questionable. Ideally, it should be really easy to define one's own syntax in any class (already possible with own compiler/parser/scanner/whatever), or maybe any method I find that it's somehow more complex with the well engineered new Compiler than it was with the very hackish legacy one, but that's a detail.
and also define ^ as a binary method:
"The ^ (hat) operator is used for exponentiation as well as conjugation by group elements, and for creating free modules of tuples and matrices."
I'm not sure this is a good idea, because ^ is used also to return values.
There is no ambiguity for ^ and i have proposed that in Squeak years ago, it's a very simple change (here for legacy Compiler) http://source.squeak.org/inbox/Compiler-nice.280.diff The only argument against it is that omitting the point ending last but one sentence would not be detected as invalid syntax self doThis. ^self doThat versus self doThis ^self doThat To address this concern, we could have rules concerning the formatting: normally we would write self doThis ^ self doThat or eventually if on several lines, we would generally indent self doThis ^ self doThat An unusual formatting is a code smell IMO And in fact, this is not much different from un-detecting when we send a message #self when forgetting the point self doThis self doThat self doThis self doThat.
A+ -- Serge Stinckwic h
Int. Research Unit on Modelling/Simulation of Complex Systems (UMMISCO) Sorbonne University (SU) French National Research Institute for Sustainable Development (IRD) U niversity of Yaoundé I, Cameroon "Programs must be written for people to read, and only incidentally for machines to execute." https://twitter.com/SergeStinckwich
Ah, and I forgot about your argumentation Stef: you cannot forbid binary selectors altogether because some are ugly @@*+!!! (I think I read this one in Asterix le gaulois) for the same reasons that youCanNOtfOrBIDunaYSElectORSWIthletTersBECauSESoMeaREUgly Le mer. 11 sept. 2019 à 19:44, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> a écrit :
Le mer. 11 sept. 2019 à 10:40, Serge Stinckwich < serge.stinckwich@gmail.com> a écrit :
On Wed, Sep 11, 2019 at 2:14 AM Gabriel Cotelli <g.cotelli@gmail.com> wrote:
Looks like Christmas season opened early this year :)
Jokes aside, I'm in favor of changing some of the characters we use for binary selectors to allow it to be used in keyword/unary messages.
I'll include % in that list. For me its more useful as a way to create percentages ( 5 % ) than to be used as a binary message for keeping an ugly name from C-like languages.
- · is middle dot and it's used in some math operations AFAIR - à is used in math also (it's used as the multiplication sign for scalars, cross product for vectors and cartesian product for sets)
One thing that would be really cool is that we can use the full power of Unicode in methods/class names. Projects like polymath and DSLs can clearly take advantage of that. Some examples I've just invented, but can be supported:
-
â from: 1 to: 5 do: [:i | i + i squared ] -
1 ⥠3 -
â anyIn: #( 1 2 4) such: [:x | x isPrime ] -
â includes: 1
Yes I would like to have something like that for PolyMath :-) Is it possible to use Unicode characters for identifiers already ?
I working on the port of : https://github.com/len/Domains to Pharo. The author modify the Cuis parser, so he can do things like that :
"â is used for direct sums, â for tensor products, Ã for cartesian product, direct product of groups, ring products, and in general for categorical products."
Of course we want to be able to use those selectors: â â etc... Not using those selectors in core image is one thing, forbiding their usage for every package is another thing
Concerning the selectors with more than 2 characters, there are two examples in use in Squeak ==> logical implication (I use it a lot when writing tests cases) <=> space ship operator /// has been used in the past (but is rather deprecated)
What is questionable is cultural acceptance of universal meaning of a Symbol <=> could have meant logical equivalence, but it would be pointless, because = (and == thanks to singleton) are already equivalence. It has been expunged from Pharo to my regrets, because it is - beautifully self defined as < = > - culturally legitimate - the art of original author (Travis Griggs) There is no sacred cow, but respect of author has a value for me.
It's sure that every binary selector might be questionable, at least in core image. For application, you never know (think DSL) we can create a lot of not completely inaesthetic ASCII styles <|> >< <+> <-> /+/ |*| For example +/- could be used for interval arithmetic (if we don't want to pay the burden of typing unicode, which ain't easy) /\ \/ intersection and union |\| the Nicolas operator - I didn't fin a usage for it yet ;) etc... So why would one want to forbid them?
For ? and ! I do not foresee elegant usage as binary, but would not miss them as regular letters eithers. It means accepting huge??? - understand isReallyHuge :) huge?:or!:???and: which are not less questionable.
Ideally, it should be really easy to define one's own syntax in any class (already possible with own compiler/parser/scanner/whatever), or maybe any method I find that it's somehow more complex with the well engineered new Compiler than it was with the very hackish legacy one, but that's a detail.
and also define ^ as a binary method:
"The ^ (hat) operator is used for exponentiation as well as conjugation by group elements, and for creating free modules of tuples and matrices."
I'm not sure this is a good idea, because ^ is used also to return values.
There is no ambiguity for ^ and i have proposed that in Squeak years ago, it's a very simple change (here for legacy Compiler) http://source.squeak.org/inbox/Compiler-nice.280.diff
The only argument against it is that omitting the point ending last but one sentence would not be detected as invalid syntax
self doThis. ^self doThat
versus
self doThis ^self doThat
To address this concern, we could have rules concerning the formatting: normally we would write
self doThis ^ self doThat
or eventually if on several lines, we would generally indent
self doThis ^ self doThat
An unusual formatting is a code smell IMO And in fact, this is not much different from un-detecting when we send a message #self when forgetting the point
self doThis self doThat
self doThis self doThat.
A+ -- Serge Stinckwic h
Int. Research Unit on Modelling/Simulation of Complex Systems (UMMISCO) Sorbonne University (SU) French National Research Institute for Sustainable Development (IRD) U niversity of Yaoundé I, Cameroon "Programs must be written for people to read, and only incidentally for machines to execute." https://twitter.com/SergeStinckwich
Wait I do not understand what you are saying :) I never said that I want to forbid anything. I just say that I would like that ? is not consider as a part of a binary selector. Amâi clearer? Stef
On 11 Sep 2019, at 19:48, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> wrote:
Ah, and I forgot about your argumentation Stef:
you cannot forbid binary selectors altogether because some are ugly @@*+!!! (I think I read this one in Asterix le gaulois) for the same reasons that youCanNOtfOrBIDunaYSElectORSWIthletTersBECauSESoMeaREUgly
Le mer. 11 sept. 2019 à 19:44, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com <mailto:nicolas.cellier.aka.nice@gmail.com>> a écrit :
Le mer. 11 sept. 2019 à 10:40, Serge Stinckwich <serge.stinckwich@gmail.com <mailto:serge.stinckwich@gmail.com>> a écrit :
On Wed, Sep 11, 2019 at 2:14 AM Gabriel Cotelli <g.cotelli@gmail.com <mailto:g.cotelli@gmail.com>> wrote: Looks like Christmas season opened early this year :)
Jokes aside, I'm in favor of changing some of the characters we use for binary selectors to allow it to be used in keyword/unary messages.
I'll include % in that list. For me its more useful as a way to create percentages ( 5 % ) than to be used as a binary message for keeping an ugly name from C-like languages. · is middle dot and it's used in some math operations AFAIR à is used in math also (it's used as the multiplication sign for scalars, cross product for vectors and cartesian product for sets) One thing that would be really cool is that we can use the full power of Unicode in methods/class names. Projects like polymath and DSLs can clearly take advantage of that. Some examples I've just invented, but can be supported:
â from: 1 to: 5 do: [:i | i + i squared ] 1 ⥠3 â anyIn: #( 1 2 4) such: [:x | x isPrime ] â includes: 1
Yes I would like to have something like that for PolyMath :-) Is it possible to use Unicode characters for identifiers already ?
I working on the port of : https://github.com/len/Domains <https://github.com/len/Domains> to Pharo. The author modify the Cuis parser, so he can do things like that :
"â is used for direct sums, â for tensor products, Ã for cartesian product, direct product of groups, ring products, and in general for categorical products."
Of course we want to be able to use those selectors: â â etc... Not using those selectors in core image is one thing, forbiding their usage for every package is another thing
Concerning the selectors with more than 2 characters, there are two examples in use in Squeak ==> logical implication (I use it a lot when writing tests cases) <=> space ship operator /// has been used in the past (but is rather deprecated)
What is questionable is cultural acceptance of universal meaning of a Symbol <=> could have meant logical equivalence, but it would be pointless, because = (and == thanks to singleton) are already equivalence. It has been expunged from Pharo to my regrets, because it is - beautifully self defined as < = > - culturally legitimate - the art of original author (Travis Griggs) There is no sacred cow, but respect of author has a value for me.
It's sure that every binary selector might be questionable, at least in core image. For application, you never know (think DSL) we can create a lot of not completely inaesthetic ASCII styles <|> >< <+> <-> /+/ |*| For example +/- could be used for interval arithmetic (if we don't want to pay the burden of typing unicode, which ain't easy) /\ \/ intersection and union |\| the Nicolas operator - I didn't fin a usage for it yet ;) etc... So why would one want to forbid them?
For ? and ! I do not foresee elegant usage as binary, but would not miss them as regular letters eithers. It means accepting huge??? - understand isReallyHuge :) huge?:or!:???and: which are not less questionable.
Ideally, it should be really easy to define one's own syntax in any class (already possible with own compiler/parser/scanner/whatever), or maybe any method I find that it's somehow more complex with the well engineered new Compiler than it was with the very hackish legacy one, but that's a detail.
and also define ^ as a binary method:
"The ^ (hat) operator is used for exponentiation as well as conjugation by group elements, and for creating free modules of tuples and matrices."
I'm not sure this is a good idea, because ^ is used also to return values.
There is no ambiguity for ^ and i have proposed that in Squeak years ago, it's a very simple change (here for legacy Compiler) http://source.squeak.org/inbox/Compiler-nice.280.diff <http://source.squeak.org/inbox/Compiler-nice.280.diff>
The only argument against it is that omitting the point ending last but one sentence would not be detected as invalid syntax
self doThis. ^self doThat
versus
self doThis ^self doThat
To address this concern, we could have rules concerning the formatting: normally we would write
self doThis ^ self doThat
or eventually if on several lines, we would generally indent
self doThis ^ self doThat
An unusual formatting is a code smell IMO And in fact, this is not much different from un-detecting when we send a message #self when forgetting the point
self doThis self doThat
self doThis self doThat.
A+ -- Serge Stinckwich Int. Research Unit on Modelling/Simulation of Complex Systems (UMMISCO) Sorbonne University (SU) French National Research Institute for Sustainable Development (IRD) University of Yaoundé I, Cameroon "Programs must be written for people to read, and only incidentally for machines to execute." https://twitter.com/SergeStinckwich <https://twitter.com/SergeStinckwich>
It was just an answer to:
Do not tell me that there is a value in these selectors?
I used the same argument for huge?:or!:???and: But I don't think it's a valid argument: it's making induction starting with a restricted set of examples... I also tried to answer to why and when a binary selector would be a "good" selector (elected for core libraries). (since you gave a list of selectors which were OK) I said that I don't really need ? nor ! in binary selectors, but neither do I in unary/keyword selectors (though I also thought using ? for boolean answer, I don't think it's really useful) Le mer. 11 sept. 2019 à 20:10, ducasse <stepharo@netcourrier.com> a écrit :
Wait I do not understand what you are saying :) I never said that I want to forbid anything. I just say that I would like that ? is not consider as a part of a binary selector. Amâi clearer?
Stef
On 11 Sep 2019, at 19:48, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> wrote:
Ah, and I forgot about your argumentation Stef:
you cannot forbid binary selectors altogether because some are ugly @@*+!!! (I think I read this one in Asterix le gaulois) for the same reasons that youCanNOtfOrBIDunaYSElectORSWIthletTersBECauSESoMeaREUgly
Le mer. 11 sept. 2019 à 19:44, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> a écrit :
Le mer. 11 sept. 2019 à 10:40, Serge Stinckwich < serge.stinckwich@gmail.com> a écrit :
On Wed, Sep 11, 2019 at 2:14 AM Gabriel Cotelli <g.cotelli@gmail.com> wrote:
Looks like Christmas season opened early this year :)
Jokes aside, I'm in favor of changing some of the characters we use for binary selectors to allow it to be used in keyword/unary messages.
I'll include % in that list. For me its more useful as a way to create percentages ( 5 % ) than to be used as a binary message for keeping an ugly name from C-like languages.
- · is middle dot and it's used in some math operations AFAIR - à is used in math also (it's used as the multiplication sign for scalars, cross product for vectors and cartesian product for sets)
One thing that would be really cool is that we can use the full power of Unicode in methods/class names. Projects like polymath and DSLs can clearly take advantage of that. Some examples I've just invented, but can be supported:
- â from: 1 to: 5 do: [:i | i + i squared ] - 1 ⥠3 - â anyIn: #( 1 2 4) such: [:x | x isPrime ] - â includes: 1
Yes I would like to have something like that for PolyMath :-) Is it possible to use Unicode characters for identifiers already ?
I working on the port of : https://github.com/len/Domains to Pharo. The author modify the Cuis parser, so he can do things like that :
"â is used for direct sums, â for tensor products, Ã for cartesian product, direct product of groups, ring products, and in general for categorical products."
Of course we want to be able to use those selectors: â â etc... Not using those selectors in core image is one thing, forbiding their usage for every package is another thing
Concerning the selectors with more than 2 characters, there are two examples in use in Squeak ==> logical implication (I use it a lot when writing tests cases) <=> space ship operator /// has been used in the past (but is rather deprecated)
What is questionable is cultural acceptance of universal meaning of a Symbol <=> could have meant logical equivalence, but it would be pointless, because = (and == thanks to singleton) are already equivalence. It has been expunged from Pharo to my regrets, because it is - beautifully self defined as < = > - culturally legitimate - the art of original author (Travis Griggs) There is no sacred cow, but respect of author has a value for me.
It's sure that every binary selector might be questionable, at least in core image. For application, you never know (think DSL) we can create a lot of not completely inaesthetic ASCII styles <|> >< <+> <-> /+/ |*| For example +/- could be used for interval arithmetic (if we don't want to pay the burden of typing unicode, which ain't easy) /\ \/ intersection and union |\| the Nicolas operator - I didn't fin a usage for it yet ;) etc... So why would one want to forbid them?
For ? and ! I do not foresee elegant usage as binary, but would not miss them as regular letters eithers. It means accepting huge??? - understand isReallyHuge :) huge?:or!:???and: which are not less questionable.
Ideally, it should be really easy to define one's own syntax in any class (already possible with own compiler/parser/scanner/whatever), or maybe any method I find that it's somehow more complex with the well engineered new Compiler than it was with the very hackish legacy one, but that's a detail.
and also define ^ as a binary method:
"The ^ (hat) operator is used for exponentiation as well as conjugation by group elements, and for creating free modules of tuples and matrices."
I'm not sure this is a good idea, because ^ is used also to return values.
There is no ambiguity for ^ and i have proposed that in Squeak years ago, it's a very simple change (here for legacy Compiler) http://source.squeak.org/inbox/Compiler-nice.280.diff
The only argument against it is that omitting the point ending last but one sentence would not be detected as invalid syntax
self doThis. ^self doThat
versus
self doThis ^self doThat
To address this concern, we could have rules concerning the formatting: normally we would write
self doThis ^ self doThat
or eventually if on several lines, we would generally indent
self doThis ^ self doThat
An unusual formatting is a code smell IMO And in fact, this is not much different from un-detecting when we send a message #self when forgetting the point
self doThis self doThat
self doThis self doThat.
A+ -- Serge Stinckwic h
Int. Research Unit on Modelling/Simulation of Complex Systems (UMMISCO) Sorbonne University (SU) French National Research Institute for Sustainable Development (IRD) U niversity of Yaoundé I, Cameroon "Programs must be written for people to read, and only incidentally for machines to execute." https://twitter.com/SergeStinckwich
Note that I also cared to handle ^ as binary selector for Opal Unfortunately the issue staled (for good or bad reasons, don't know...) https://pharo.fogbugz.com/f/cases/13078/Allow-upArrow-caret-as-a-binary-sele... Le mer. 11 sept. 2019 à 21:21, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> a écrit :
It was just an answer to:
Do not tell me that there is a value in these selectors?
I used the same argument for huge?:or!:???and: But I don't think it's a valid argument: it's making induction starting with a restricted set of examples...
I also tried to answer to why and when a binary selector would be a "good" selector (elected for core libraries). (since you gave a list of selectors which were OK)
I said that I don't really need ? nor ! in binary selectors, but neither do I in unary/keyword selectors (though I also thought using ? for boolean answer, I don't think it's really useful)
Le mer. 11 sept. 2019 à 20:10, ducasse <stepharo@netcourrier.com> a écrit :
Wait I do not understand what you are saying :) I never said that I want to forbid anything. I just say that I would like that ? is not consider as a part of a binary selector. Amâi clearer?
Stef
On 11 Sep 2019, at 19:48, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> wrote:
Ah, and I forgot about your argumentation Stef:
you cannot forbid binary selectors altogether because some are ugly @@*+!!! (I think I read this one in Asterix le gaulois) for the same reasons that youCanNOtfOrBIDunaYSElectORSWIthletTersBECauSESoMeaREUgly
Le mer. 11 sept. 2019 à 19:44, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> a écrit :
Le mer. 11 sept. 2019 à 10:40, Serge Stinckwich < serge.stinckwich@gmail.com> a écrit :
On Wed, Sep 11, 2019 at 2:14 AM Gabriel Cotelli <g.cotelli@gmail.com> wrote:
Looks like Christmas season opened early this year :)
Jokes aside, I'm in favor of changing some of the characters we use for binary selectors to allow it to be used in keyword/unary messages.
I'll include % in that list. For me its more useful as a way to create percentages ( 5 % ) than to be used as a binary message for keeping an ugly name from C-like languages.
- · is middle dot and it's used in some math operations AFAIR - à is used in math also (it's used as the multiplication sign for scalars, cross product for vectors and cartesian product for sets)
One thing that would be really cool is that we can use the full power of Unicode in methods/class names. Projects like polymath and DSLs can clearly take advantage of that. Some examples I've just invented, but can be supported:
- â from: 1 to: 5 do: [:i | i + i squared ] - 1 ⥠3 - â anyIn: #( 1 2 4) such: [:x | x isPrime ] - â includes: 1
Yes I would like to have something like that for PolyMath :-) Is it possible to use Unicode characters for identifiers already ?
I working on the port of : https://github.com/len/Domains to Pharo. The author modify the Cuis parser, so he can do things like that :
"â is used for direct sums, â for tensor products, Ã for cartesian product, direct product of groups, ring products, and in general for categorical products."
Of course we want to be able to use those selectors: â â etc... Not using those selectors in core image is one thing, forbiding their usage for every package is another thing
Concerning the selectors with more than 2 characters, there are two examples in use in Squeak ==> logical implication (I use it a lot when writing tests cases) <=> space ship operator /// has been used in the past (but is rather deprecated)
What is questionable is cultural acceptance of universal meaning of a Symbol <=> could have meant logical equivalence, but it would be pointless, because = (and == thanks to singleton) are already equivalence. It has been expunged from Pharo to my regrets, because it is - beautifully self defined as < = > - culturally legitimate - the art of original author (Travis Griggs) There is no sacred cow, but respect of author has a value for me.
It's sure that every binary selector might be questionable, at least in core image. For application, you never know (think DSL) we can create a lot of not completely inaesthetic ASCII styles <|> >< <+> <-> /+/ |*| For example +/- could be used for interval arithmetic (if we don't want to pay the burden of typing unicode, which ain't easy) /\ \/ intersection and union |\| the Nicolas operator - I didn't fin a usage for it yet ;) etc... So why would one want to forbid them?
For ? and ! I do not foresee elegant usage as binary, but would not miss them as regular letters eithers. It means accepting huge??? - understand isReallyHuge :) huge?:or!:???and: which are not less questionable.
Ideally, it should be really easy to define one's own syntax in any class (already possible with own compiler/parser/scanner/whatever), or maybe any method I find that it's somehow more complex with the well engineered new Compiler than it was with the very hackish legacy one, but that's a detail.
and also define ^ as a binary method:
"The ^ (hat) operator is used for exponentiation as well as conjugation by group elements, and for creating free modules of tuples and matrices."
I'm not sure this is a good idea, because ^ is used also to return values.
There is no ambiguity for ^ and i have proposed that in Squeak years ago, it's a very simple change (here for legacy Compiler) http://source.squeak.org/inbox/Compiler-nice.280.diff
The only argument against it is that omitting the point ending last but one sentence would not be detected as invalid syntax
self doThis. ^self doThat
versus
self doThis ^self doThat
To address this concern, we could have rules concerning the formatting: normally we would write
self doThis ^ self doThat
or eventually if on several lines, we would generally indent
self doThis ^ self doThat
An unusual formatting is a code smell IMO And in fact, this is not much different from un-detecting when we send a message #self when forgetting the point
self doThis self doThat
self doThis self doThat.
A+ -- Serge Stinckwic h
Int. Research Unit on Modelling/Simulation of Complex Systems (UMMISCO) Sorbonne University (SU) French National Research Institute for Sustainable Development (IRD) U niversity of Yaoundé I, Cameroon "Programs must be written for people to read, and only incidentally for machines to execute." https://twitter.com/SergeStinckwich
And to finish with ^, hare is an older implementation http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March/015491.htm... And the classical refutation (we should not bother too much about it) http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March/005777.htm... Le jeu. 12 sept. 2019 à 20:37, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> a écrit :
Note that I also cared to handle ^ as binary selector for Opal Unfortunately the issue staled (for good or bad reasons, don't know...)
https://pharo.fogbugz.com/f/cases/13078/Allow-upArrow-caret-as-a-binary-sele...
Le mer. 11 sept. 2019 à 21:21, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> a écrit :
It was just an answer to:
Do not tell me that there is a value in these selectors?
I used the same argument for huge?:or!:???and: But I don't think it's a valid argument: it's making induction starting with a restricted set of examples...
I also tried to answer to why and when a binary selector would be a "good" selector (elected for core libraries). (since you gave a list of selectors which were OK)
I said that I don't really need ? nor ! in binary selectors, but neither do I in unary/keyword selectors (though I also thought using ? for boolean answer, I don't think it's really useful)
Le mer. 11 sept. 2019 à 20:10, ducasse <stepharo@netcourrier.com> a écrit :
Wait I do not understand what you are saying :) I never said that I want to forbid anything. I just say that I would like that ? is not consider as a part of a binary selector. Amâi clearer?
Stef
On 11 Sep 2019, at 19:48, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> wrote:
Ah, and I forgot about your argumentation Stef:
you cannot forbid binary selectors altogether because some are ugly @@*+!!! (I think I read this one in Asterix le gaulois) for the same reasons that youCanNOtfOrBIDunaYSElectORSWIthletTersBECauSESoMeaREUgly
Le mer. 11 sept. 2019 à 19:44, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> a écrit :
Le mer. 11 sept. 2019 à 10:40, Serge Stinckwich < serge.stinckwich@gmail.com> a écrit :
On Wed, Sep 11, 2019 at 2:14 AM Gabriel Cotelli <g.cotelli@gmail.com> wrote:
Looks like Christmas season opened early this year :)
Jokes aside, I'm in favor of changing some of the characters we use for binary selectors to allow it to be used in keyword/unary messages.
I'll include % in that list. For me its more useful as a way to create percentages ( 5 % ) than to be used as a binary message for keeping an ugly name from C-like languages.
- · is middle dot and it's used in some math operations AFAIR - à is used in math also (it's used as the multiplication sign for scalars, cross product for vectors and cartesian product for sets)
One thing that would be really cool is that we can use the full power of Unicode in methods/class names. Projects like polymath and DSLs can clearly take advantage of that. Some examples I've just invented, but can be supported:
- â from: 1 to: 5 do: [:i | i + i squared ] - 1 ⥠3 - â anyIn: #( 1 2 4) such: [:x | x isPrime ] - â includes: 1
Yes I would like to have something like that for PolyMath :-) Is it possible to use Unicode characters for identifiers already ?
I working on the port of : https://github.com/len/Domains to Pharo. The author modify the Cuis parser, so he can do things like that :
"â is used for direct sums, â for tensor products, Ã for cartesian product, direct product of groups, ring products, and in general for categorical products."
Of course we want to be able to use those selectors: â â etc... Not using those selectors in core image is one thing, forbiding their usage for every package is another thing
Concerning the selectors with more than 2 characters, there are two examples in use in Squeak ==> logical implication (I use it a lot when writing tests cases) <=> space ship operator /// has been used in the past (but is rather deprecated)
What is questionable is cultural acceptance of universal meaning of a Symbol <=> could have meant logical equivalence, but it would be pointless, because = (and == thanks to singleton) are already equivalence. It has been expunged from Pharo to my regrets, because it is - beautifully self defined as < = > - culturally legitimate - the art of original author (Travis Griggs) There is no sacred cow, but respect of author has a value for me.
It's sure that every binary selector might be questionable, at least in core image. For application, you never know (think DSL) we can create a lot of not completely inaesthetic ASCII styles <|> >< <+> <-> /+/ |*| For example +/- could be used for interval arithmetic (if we don't want to pay the burden of typing unicode, which ain't easy) /\ \/ intersection and union |\| the Nicolas operator - I didn't fin a usage for it yet ;) etc... So why would one want to forbid them?
For ? and ! I do not foresee elegant usage as binary, but would not miss them as regular letters eithers. It means accepting huge??? - understand isReallyHuge :) huge?:or!:???and: which are not less questionable.
Ideally, it should be really easy to define one's own syntax in any class (already possible with own compiler/parser/scanner/whatever), or maybe any method I find that it's somehow more complex with the well engineered new Compiler than it was with the very hackish legacy one, but that's a detail.
and also define ^ as a binary method:
"The ^ (hat) operator is used for exponentiation as well as conjugation by group elements, and for creating free modules of tuples and matrices."
I'm not sure this is a good idea, because ^ is used also to return values.
There is no ambiguity for ^ and i have proposed that in Squeak years ago, it's a very simple change (here for legacy Compiler) http://source.squeak.org/inbox/Compiler-nice.280.diff
The only argument against it is that omitting the point ending last but one sentence would not be detected as invalid syntax
self doThis. ^self doThat
versus
self doThis ^self doThat
To address this concern, we could have rules concerning the formatting: normally we would write
self doThis ^ self doThat
or eventually if on several lines, we would generally indent
self doThis ^ self doThat
An unusual formatting is a code smell IMO And in fact, this is not much different from un-detecting when we send a message #self when forgetting the point
self doThis self doThat
self doThis self doThat.
A+ -- Serge Stinckwic h
Int. Research Unit on Modelling/Simulation of Complex Systems (UMMISCO) Sorbonne University (SU) French National Research Institute for Sustainable Development (IRD) U niversity of Yaoundé I, Cameroon "Programs must be written for people to read, and only incidentally for machines to execute." https://twitter.com/SergeStinckwich
Funnily, in same period you could find defenders of ? in binary selectors: http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March/008893.htm... and more geenral discussion about binary selectors: http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March/001466.htm... Stef, u gonna hate me for living in the past ;) But you don't have to be stuck of course :) Le jeu. 12 sept. 2019 à 21:39, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> a écrit :
And to finish with ^, hare is an older implementation
http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March/015491.htm...
And the classical refutation (we should not bother too much about it)
http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March/005777.htm...
Le jeu. 12 sept. 2019 à 20:37, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> a écrit :
Note that I also cared to handle ^ as binary selector for Opal Unfortunately the issue staled (for good or bad reasons, don't know...)
https://pharo.fogbugz.com/f/cases/13078/Allow-upArrow-caret-as-a-binary-sele...
Le mer. 11 sept. 2019 à 21:21, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> a écrit :
It was just an answer to:
Do not tell me that there is a value in these selectors?
I used the same argument for huge?:or!:???and: But I don't think it's a valid argument: it's making induction starting with a restricted set of examples...
I also tried to answer to why and when a binary selector would be a "good" selector (elected for core libraries). (since you gave a list of selectors which were OK)
I said that I don't really need ? nor ! in binary selectors, but neither do I in unary/keyword selectors (though I also thought using ? for boolean answer, I don't think it's really useful)
Le mer. 11 sept. 2019 à 20:10, ducasse <stepharo@netcourrier.com> a écrit :
Wait I do not understand what you are saying :) I never said that I want to forbid anything. I just say that I would like that ? is not consider as a part of a binary selector. Amâi clearer?
Stef
On 11 Sep 2019, at 19:48, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> wrote:
Ah, and I forgot about your argumentation Stef:
you cannot forbid binary selectors altogether because some are ugly @@*+!!! (I think I read this one in Asterix le gaulois) for the same reasons that youCanNOtfOrBIDunaYSElectORSWIthletTersBECauSESoMeaREUgly
Le mer. 11 sept. 2019 à 19:44, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> a écrit :
Le mer. 11 sept. 2019 à 10:40, Serge Stinckwich < serge.stinckwich@gmail.com> a écrit :
On Wed, Sep 11, 2019 at 2:14 AM Gabriel Cotelli <g.cotelli@gmail.com> wrote:
Looks like Christmas season opened early this year :)
Jokes aside, I'm in favor of changing some of the characters we use for binary selectors to allow it to be used in keyword/unary messages.
I'll include % in that list. For me its more useful as a way to create percentages ( 5 % ) than to be used as a binary message for keeping an ugly name from C-like languages.
- · is middle dot and it's used in some math operations AFAIR - à is used in math also (it's used as the multiplication sign for scalars, cross product for vectors and cartesian product for sets)
One thing that would be really cool is that we can use the full power of Unicode in methods/class names. Projects like polymath and DSLs can clearly take advantage of that. Some examples I've just invented, but can be supported:
- â from: 1 to: 5 do: [:i | i + i squared ] - 1 ⥠3 - â anyIn: #( 1 2 4) such: [:x | x isPrime ] - â includes: 1
Yes I would like to have something like that for PolyMath :-) Is it possible to use Unicode characters for identifiers already ?
I working on the port of : https://github.com/len/Domains to Pharo. The author modify the Cuis parser, so he can do things like that :
"â is used for direct sums, â for tensor products, Ã for cartesian product, direct product of groups, ring products, and in general for categorical products."
Of course we want to be able to use those selectors: â â etc... Not using those selectors in core image is one thing, forbiding their usage for every package is another thing
Concerning the selectors with more than 2 characters, there are two examples in use in Squeak ==> logical implication (I use it a lot when writing tests cases) <=> space ship operator /// has been used in the past (but is rather deprecated)
What is questionable is cultural acceptance of universal meaning of a Symbol <=> could have meant logical equivalence, but it would be pointless, because = (and == thanks to singleton) are already equivalence. It has been expunged from Pharo to my regrets, because it is - beautifully self defined as < = > - culturally legitimate - the art of original author (Travis Griggs) There is no sacred cow, but respect of author has a value for me.
It's sure that every binary selector might be questionable, at least in core image. For application, you never know (think DSL) we can create a lot of not completely inaesthetic ASCII styles <|> >< <+> <-> /+/ |*| For example +/- could be used for interval arithmetic (if we don't want to pay the burden of typing unicode, which ain't easy) /\ \/ intersection and union |\| the Nicolas operator - I didn't fin a usage for it yet ;) etc... So why would one want to forbid them?
For ? and ! I do not foresee elegant usage as binary, but would not miss them as regular letters eithers. It means accepting huge??? - understand isReallyHuge :) huge?:or!:???and: which are not less questionable.
Ideally, it should be really easy to define one's own syntax in any class (already possible with own compiler/parser/scanner/whatever), or maybe any method I find that it's somehow more complex with the well engineered new Compiler than it was with the very hackish legacy one, but that's a detail.
and also define ^ as a binary method:
"The ^ (hat) operator is used for exponentiation as well as conjugation by group elements, and for creating free modules of tuples and matrices."
I'm not sure this is a good idea, because ^ is used also to return values.
There is no ambiguity for ^ and i have proposed that in Squeak years ago, it's a very simple change (here for legacy Compiler) http://source.squeak.org/inbox/Compiler-nice.280.diff
The only argument against it is that omitting the point ending last but one sentence would not be detected as invalid syntax
self doThis. ^self doThat
versus
self doThis ^self doThat
To address this concern, we could have rules concerning the formatting: normally we would write
self doThis ^ self doThat
or eventually if on several lines, we would generally indent
self doThis ^ self doThat
An unusual formatting is a code smell IMO And in fact, this is not much different from un-detecting when we send a message #self when forgetting the point
self doThis self doThat
self doThis self doThat.
A+ -- Serge Stinckwic h
Int. Research Unit on Modelling/Simulation of Complex Systems (UMMISCO) Sorbonne University (SU) French National Research Institute for Sustainable Development (IRD) U niversity of Yaoundé I, Cameroon "Programs must be written for people to read, and only incidentally for machines to execute." https://twitter.com/SergeStinckwich
Teaching pharo too late yesterday, headache now. I will reply. Now you probably see that Iâm learning and changing my mind :) Stef
On 12 Sep 2019, at 21:57, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> wrote:
Funnily, in same period you could find defenders of ? in binary selectors: http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March/008893.htm... <http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March/008893.htm...>
and more geenral discussion about binary selectors: http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March/001466.htm... <http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March/001466.htm...>
Stef, u gonna hate me for living in the past ;) But you don't have to be stuck of course :)
Le jeu. 12 sept. 2019 à 21:39, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com <mailto:nicolas.cellier.aka.nice@gmail.com>> a écrit : And to finish with ^, hare is an older implementation http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March/015491.htm... <http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March/015491.htm...>
And the classical refutation (we should not bother too much about it) http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March/005777.htm... <http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March/005777.htm...> Le jeu. 12 sept. 2019 à 20:37, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com <mailto:nicolas.cellier.aka.nice@gmail.com>> a écrit : Note that I also cared to handle ^ as binary selector for Opal Unfortunately the issue staled (for good or bad reasons, don't know...)
https://pharo.fogbugz.com/f/cases/13078/Allow-upArrow-caret-as-a-binary-sele... <https://pharo.fogbugz.com/f/cases/13078/Allow-upArrow-caret-as-a-binary-sele...> Le mer. 11 sept. 2019 à 21:21, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com <mailto:nicolas.cellier.aka.nice@gmail.com>> a écrit : It was just an answer to:
Do not tell me that there is a value in these selectors?
I used the same argument for huge?:or!:???and: But I don't think it's a valid argument: it's making induction starting with a restricted set of examples...
I also tried to answer to why and when a binary selector would be a "good" selector (elected for core libraries). (since you gave a list of selectors which were OK)
I said that I don't really need ? nor ! in binary selectors, but neither do I in unary/keyword selectors (though I also thought using ? for boolean answer, I don't think it's really useful)
Le mer. 11 sept. 2019 à 20:10, ducasse <stepharo@netcourrier.com <mailto:stepharo@netcourrier.com>> a écrit : Wait I do not understand what you are saying :) I never said that I want to forbid anything. I just say that I would like that ? is not consider as a part of a binary selector. Amâi clearer?
Stef
On 11 Sep 2019, at 19:48, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com <mailto:nicolas.cellier.aka.nice@gmail.com>> wrote:
Ah, and I forgot about your argumentation Stef:
you cannot forbid binary selectors altogether because some are ugly @@*+!!! (I think I read this one in Asterix le gaulois) for the same reasons that youCanNOtfOrBIDunaYSElectORSWIthletTersBECauSESoMeaREUgly
Le mer. 11 sept. 2019 à 19:44, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com <mailto:nicolas.cellier.aka.nice@gmail.com>> a écrit :
Le mer. 11 sept. 2019 à 10:40, Serge Stinckwich <serge.stinckwich@gmail.com <mailto:serge.stinckwich@gmail.com>> a écrit :
On Wed, Sep 11, 2019 at 2:14 AM Gabriel Cotelli <g.cotelli@gmail.com <mailto:g.cotelli@gmail.com>> wrote: Looks like Christmas season opened early this year :)
Jokes aside, I'm in favor of changing some of the characters we use for binary selectors to allow it to be used in keyword/unary messages.
I'll include % in that list. For me its more useful as a way to create percentages ( 5 % ) than to be used as a binary message for keeping an ugly name from C-like languages. · is middle dot and it's used in some math operations AFAIR à is used in math also (it's used as the multiplication sign for scalars, cross product for vectors and cartesian product for sets) One thing that would be really cool is that we can use the full power of Unicode in methods/class names. Projects like polymath and DSLs can clearly take advantage of that. Some examples I've just invented, but can be supported:
â from: 1 to: 5 do: [:i | i + i squared ] 1 ⥠3 â anyIn: #( 1 2 4) such: [:x | x isPrime ] â includes: 1
Yes I would like to have something like that for PolyMath :-) Is it possible to use Unicode characters for identifiers already ?
I working on the port of : https://github.com/len/Domains <https://github.com/len/Domains> to Pharo. The author modify the Cuis parser, so he can do things like that :
"â is used for direct sums, â for tensor products, Ã for cartesian product, direct product of groups, ring products, and in general for categorical products."
Of course we want to be able to use those selectors: â â etc... Not using those selectors in core image is one thing, forbiding their usage for every package is another thing
Concerning the selectors with more than 2 characters, there are two examples in use in Squeak ==> logical implication (I use it a lot when writing tests cases) <=> space ship operator /// has been used in the past (but is rather deprecated)
What is questionable is cultural acceptance of universal meaning of a Symbol <=> could have meant logical equivalence, but it would be pointless, because = (and == thanks to singleton) are already equivalence. It has been expunged from Pharo to my regrets, because it is - beautifully self defined as < = > - culturally legitimate - the art of original author (Travis Griggs) There is no sacred cow, but respect of author has a value for me.
It's sure that every binary selector might be questionable, at least in core image. For application, you never know (think DSL) we can create a lot of not completely inaesthetic ASCII styles <|> >< <+> <-> /+/ |*| For example +/- could be used for interval arithmetic (if we don't want to pay the burden of typing unicode, which ain't easy) /\ \/ intersection and union |\| the Nicolas operator - I didn't fin a usage for it yet ;) etc... So why would one want to forbid them?
For ? and ! I do not foresee elegant usage as binary, but would not miss them as regular letters eithers. It means accepting huge??? - understand isReallyHuge :) huge?:or!:???and: which are not less questionable.
Ideally, it should be really easy to define one's own syntax in any class (already possible with own compiler/parser/scanner/whatever), or maybe any method I find that it's somehow more complex with the well engineered new Compiler than it was with the very hackish legacy one, but that's a detail.
and also define ^ as a binary method:
"The ^ (hat) operator is used for exponentiation as well as conjugation by group elements, and for creating free modules of tuples and matrices."
I'm not sure this is a good idea, because ^ is used also to return values.
There is no ambiguity for ^ and i have proposed that in Squeak years ago, it's a very simple change (here for legacy Compiler) http://source.squeak.org/inbox/Compiler-nice.280.diff <http://source.squeak.org/inbox/Compiler-nice.280.diff>
The only argument against it is that omitting the point ending last but one sentence would not be detected as invalid syntax
self doThis. ^self doThat
versus
self doThis ^self doThat
To address this concern, we could have rules concerning the formatting: normally we would write
self doThis ^ self doThat
or eventually if on several lines, we would generally indent
self doThis ^ self doThat
An unusual formatting is a code smell IMO And in fact, this is not much different from un-detecting when we send a message #self when forgetting the point
self doThis self doThat
self doThis self doThat.
A+ -- Serge Stinckwich Int. Research Unit on Modelling/Simulation of Complex Systems (UMMISCO) Sorbonne University (SU) French National Research Institute for Sustainable Development (IRD) University of Yaoundé I, Cameroon "Programs must be written for people to read, and only incidentally for machines to execute." https://twitter.com/SergeStinckwich <https://twitter.com/SergeStinckwich>
Would use of ? and ! in unary/keyword selectors be convention or somehow required? If simply convention, then we should start with renaming testing methods to be named is* or has*. flag1 := anInteger even. ânot good" flag2 := anInteger isEven. âbetter" flag3 := anInteger even?. âhow much better?â flag4 := #(1 2 3) includes?: 2. âhow much better?" Iâm not convinced that having another way to indicate a testing method will help if people still donât name methods well. Also, can you give an example of where ! would clarify the meaning? Are you thinking of the following: myPoint x!: 3. myArray at: 1 put!: nil. Those donât seem to be much improved! Iâm not arguing for âcompatibility" or "staying in the past." Iâm just trying to understand the benefit. Thanks, James
On Sep 10, 2019, at 1:14 PM, ducasse <stepharo@netcourrier.com> wrote:
I would love to retract ? and ! from the list of binary selectors. Iâm super super frustrated that predicates cannot be easily identifiable.
for example is lineUpBlockBrackets an action or a testing method.
I think that we are trapped in mistakes from the past. In racket and scheme and I guess ruby too we can use ? in the method and this change the game.
self lineUpBlockBrackets?
We have plenty of binary selector parts that are not used and think that it is frustrating.
Let us check:
Character specialCharacters
'+-/\*~<>=@,%|&?!·÷±Ã'
+ - / \ ~ <
= @ , & | %
those are ok
I have no idea what is · nor how to type it. ÷ looks from the past. ± so funny à no idea what it is andâ¦.
Then we have two that could really improve our language ? and !
Do not tell me that there is a value in these selectors?
(#(#+ #- #/ #\ #* #~ #< #> #= #@ #, #% #| #& #? #!) combinations select: [ :each | each size = 3 and: [ each includesAnyOf: #(#? #!) ] ]) collect: [ :each | each first, each second, each third ]
#(#'+-?' #'+-!' #'+/?' #'+/!' #'+\?' #'+\!' #'+*?' #'+*!' #'+~?' #'+~!' #'+<?' #'+<!' #'+>?' #'+>!' #'+=?' #'+=!' #'+@?' #'+@!' #'+,?' #'+,!' #'+%?' #'+%!' #'+|?' #'+|!' #'+&?' #'+&!' #'+?!' #'-/?' #'-/!' #'-\?' #'-\!' #'-*?' #'-*!' #'-~?' #'-~!' #'-<?' #'-<!' #'->?' #'->!' #'-=?' #'-=!' #'-@?' #'-@!' #'-,?' #'-,!' #'-%?' #'-%!' #'-|?' #'-|!' #'-&?' #'-&!' #'-?!' #'/\?' #'/\!' #'/*?' #'/*!' #'/~?' #'/~!' #'/<?' #'/<!' #'/>?' #'/>!' #'/=?' #'/=!' #'/@?' #'/@!' #'/,?' #'/,!' #'/%?' #'/%!' #'/|?' #'/|!' #'/&?' #'/&!' #'/?!' #'\*?' #'\*!' #'\~?' #'\~!' #'\<?' #'\<!' #'\>?' #'\>!' #'\=?' #'\=!' #'\@?' #'\@!' #'\,?' #'\,!' #'\%?' #'\%!' #'\|?' #'\|!' #'\&?' #'\&!' #'\?!' #'*~?' #'*~!' #'*<?' #'*<!' #'*>?' #'*>!' #'*=?' #'*=!' #'*@?' #'*@!' #'*,?' #'*,!' #'*%?' #'*%!' #'*|?' #'*|!' #'*&?' #'*&!' #'*?!' #'~<?' #'~<!' #'~>?' #'~>!' #'~=?' #'~=!' #'~@?' #'~@!' #'~,?' #'~,!' #'~%?' #'~%!' #'~|?' #'~|!' #'~&?' #'~&!' #'~?!' #'<>?' #'<>!' #'<=?' #'<=!' #'<@?' #'<@!' #'<,?' #'<,!' #'<%?' #'<%!' #'<|?' #'<|!' #'<&?' #'<&!' #'<?!' #'>=?' #'>=!' #'>@?' #'>@!' #'>,?' #'>,!' #'>%?' #'>%!' #'>|?' #'>|!' #'>&?' #'>&!' #'>?!' #'=@?' #'=@!' #'=,?' #'=,!' #'=%?' #'=%!' #'=|?' #'=|!' #'=&?' #'=&!' #'=?!' #'@,?' #'@,!' #'@%?' #'@%!' #'@|?' #'@|!' #'@&?' #'@&!' #'@?!' #',%?' #',%!' #',|?' #',|!' #',&?' #',&!' #',?!' #'%|?' #'%|!' #'%&?' #'%&!' #'%?!' #'|&?' #'|&!' #'|?!' #'&?!â)
may be this one #&?! is useful for WTF!
And because of that we sacrifice having nice method names! I really think that we should change that.
S.
On 11 Sep 2019, at 04:07, James Foster <Smalltalk@JGFoster.net> wrote:
Would use of ? and ! in unary/keyword selectors be convention or somehow required? If simply convention, then we should start with renaming testing methods to be named is* or has*. flag1 := anInteger even. ânot good" flag2 := anInteger isEven. âbetter" flag3 := anInteger even?. âhow much better?â flag4 := #(1 2 3) includes?: 2. âhow much better?â
I think that I would use ? mainly for unary message Now Iâm sure that if you look carefully some people use include for the action includes for the tests I took include as an example and this is super not intention revealing.
lineUpBlockBrackets
lineUpBlockBrackets? Now I will rewrite them all as shouldLineUpBlockBrackets or isLineUpBlockBrackets and to me for unary message ? makes it a lot better.
Iâm not convinced that having another way to indicate a testing method will help if people still donât name methods well.
Also, can you give an example of where ! would clarify the meaning? Are you thinking of the following: myPoint x!: 3. myArray at: 1 put!: nil. Those donât seem to be much improved!
Pay attention you cannot use ! as separator. For ! I do not care now.
Iâm not arguing for âcompatibility" or "staying in the past." Iâm just trying to understand the benefit.
The question ?
Thanks,
James
On Sep 10, 2019, at 1:14 PM, ducasse <stepharo@netcourrier.com> wrote:
I would love to retract ? and ! from the list of binary selectors. Iâm super super frustrated that predicates cannot be easily identifiable.
for example is lineUpBlockBrackets an action or a testing method.
I think that we are trapped in mistakes from the past. In racket and scheme and I guess ruby too we can use ? in the method and this change the game.
self lineUpBlockBrackets?
We have plenty of binary selector parts that are not used and think that it is frustrating.
Let us check:
Character specialCharacters
'+-/\*~<>=@,%|&?!·÷±Ã'
+ - / \ ~ <
= @ , & | %
those are ok
I have no idea what is · nor how to type it. ÷ looks from the past. ± so funny à no idea what it is andâ¦.
Then we have two that could really improve our language ? and !
Do not tell me that there is a value in these selectors?
(#(#+ #- #/ #\ #* #~ #< #> #= #@ #, #% #| #& #? #!) combinations select: [ :each | each size = 3 and: [ each includesAnyOf: #(#? #!) ] ]) collect: [ :each | each first, each second, each third ]
#(#'+-?' #'+-!' #'+/?' #'+/!' #'+\?' #'+\!' #'+*?' #'+*!' #'+~?' #'+~!' #'+<?' #'+<!' #'+>?' #'+>!' #'+=?' #'+=!' #'+@?' #'+@!' #'+,?' #'+,!' #'+%?' #'+%!' #'+|?' #'+|!' #'+&?' #'+&!' #'+?!' #'-/?' #'-/!' #'-\?' #'-\!' #'-*?' #'-*!' #'-~?' #'-~!' #'-<?' #'-<!' #'->?' #'->!' #'-=?' #'-=!' #'-@?' #'-@!' #'-,?' #'-,!' #'-%?' #'-%!' #'-|?' #'-|!' #'-&?' #'-&!' #'-?!' #'/\?' #'/\!' #'/*?' #'/*!' #'/~?' #'/~!' #'/<?' #'/<!' #'/>?' #'/>!' #'/=?' #'/=!' #'/@?' #'/@!' #'/,?' #'/,!' #'/%?' #'/%!' #'/|?' #'/|!' #'/&?' #'/&!' #'/?!' #'\*?' #'\*!' #'\~?' #'\~!' #'\<?' #'\<!' #'\>?' #'\>!' #'\=?' #'\=!' #'\@?' #'\@!' #'\,?' #'\,!' #'\%?' #'\%!' #'\|?' #'\|!' #'\&?' #'\&!' #'\?!' #'*~?' #'*~!' #'*<?' #'*<!' #'*>?' #'*>!' #'*=?' #'*=!' #'*@?' #'*@!' #'*,?' #'*,!' #'*%?' #'*%!' #'*|?' #'*|!' #'*&?' #'*&!' #'*?!' #'~<?' #'~<!' #'~>?' #'~>!' #'~=?' #'~=!' #'~@?' #'~@!' #'~,?' #'~,!' #'~%?' #'~%!' #'~|?' #'~|!' #'~&?' #'~&!' #'~?!' #'<>?' #'<>!' #'<=?' #'<=!' #'<@?' #'<@!' #'<,?' #'<,!' #'<%?' #'<%!' #'<|?' #'<|!' #'<&?' #'<&!' #'<?!' #'>=?' #'>=!' #'>@?' #'>@!' #'>,?' #'>,!' #'>%?' #'>%!' #'>|?' #'>|!' #'>&?' #'>&!' #'>?!' #'=@?' #'=@!' #'=,?' #'=,!' #'=%?' #'=%!' #'=|?' #'=|!' #'=&?' #'=&!' #'=?!' #'@,?' #'@,!' #'@%?' #'@%!' #'@|?' #'@|!' #'@&?' #'@&!' #'@?!' #',%?' #',%!' #',|?' #',|!' #',&?' #',&!' #',?!' #'%|?' #'%|!' #'%&?' #'%&!' #'%?!' #'|&?' #'|&!' #'|?!' #'&?!â)
may be this one #&?! is useful for WTF!
And because of that we sacrifice having nice method names! I really think that we should change that.
S.
Using ? for unary messages does not compose so well when you want to do some logical conditions. For example self isClass? or: [ self isTrait? ] . It's readable, but probably you want the ? just at the end of the sentence. For ! one use case is to use it for factorial, like we do in Math. So 5 ! --> 120. Also I don't know any good use case for ! as binary selector. ? has only one implementor in the Pharo image in some Url related code for query parameters. BTW, still using * for multiplication feels so 90's. :) On Wed, Sep 11, 2019 at 4:10 AM ducasse <stepharo@netcourrier.com> wrote:
On 11 Sep 2019, at 04:07, James Foster <Smalltalk@JGFoster.net> wrote:
Would use of ? and ! in unary/keyword selectors be convention or somehow required? If simply convention, then we should start with renaming testing methods to be named is* or has*. flag1 := anInteger even. ânot good" flag2 := anInteger isEven. âbetter" flag3 := anInteger even?. âhow much better?â flag4 := #(1 2 3) includes?: 2. âhow much better?â
I think that I would use ? mainly for unary message
Now Iâm sure that if you look carefully some people use
include for the action includes for the tests
I took include as an example and this is super not intention revealing.
lineUpBlockBrackets
lineUpBlockBrackets? Now I will rewrite them all as shouldLineUpBlockBrackets or isLineUpBlockBrackets and to me for unary message ? makes it a lot better.
Iâm not convinced that having another way to indicate a testing method will help if people still donât name methods well.
Also, can you give an example of where ! would clarify the meaning? Are you thinking of the following: myPoint x!: 3. myArray at: 1 put!: nil. Those donât seem to be much improved!
Pay attention you cannot use ! as separator. For ! I do not care now.
Iâm not arguing for âcompatibility" or "staying in the past." Iâm just trying to understand the benefit.
The question ?
Thanks,
James
On Sep 10, 2019, at 1:14 PM, ducasse <stepharo@netcourrier.com> wrote:
I would love to retract ? and ! from the list of binary selectors. Iâm super super frustrated that predicates cannot be easily
identifiable.
for example is lineUpBlockBrackets an action or a testing method.
I think that we are trapped in mistakes from the past. In racket and scheme and I guess ruby too we can use ? in the method
and
this change the game.
self lineUpBlockBrackets?
We have plenty of binary selector parts that are not used and think that it is frustrating.
Let us check:
Character specialCharacters
'+-/\*~<>=@,%|&?!·÷±Ã'
+ - / \ ~ <
= @ , & | %
those are ok
I have no idea what is · nor how to type it. ÷ looks from the past. ± so funny à no idea what it is andâ¦.
Then we have two that could really improve our language ? and !
Do not tell me that there is a value in these selectors?
(#(#+ #- #/ #\ #* #~ #< #> #= #@ #, #% #| #& #? #!) combinations select: [ :each | each size = 3 and: [ each includesAnyOf: #(#? #!) ] ]) collect: [ :each | each first, each second, each third ]
#(#'+-?' #'+-!' #'+/?' #'+/!' #'+\?' #'+\!' #'+*?' #'+*!' #'+~?' #'+~!' #'+<?' #'+<!' #'+>?' #'+>!' #'+=?' #'+=!' #'+@?' #'+@!' #'+,?' #'+,!' #'+%?' #'+%!' #'+|?' #'+|!' #'+&?' #'+&!' #'+?!' #'-/?' #'-/!' #'-\?' #'-\!' #'-*?' #'-*!' #'-~?' #'-~!' #'-<?' #'-<!' #'->?' #'->!' #'-=?' #'-=!' #'-@?' #'-@!' #'-,?' #'-,!' #'-%?' #'-%!' #'-|?' #'-|!' #'-&?' #'-&!' #'-?!' #'/\?' #'/\!' #'/*?' #'/*!' #'/~?' #'/~!' #'/<?' #'/<!' #'/>?' #'/>!' #'/=?' #'/=!' #'/@?' #'/@!' #'/,?' #'/,!' #'/%?' #'/%!' #'/|?' #'/|!' #'/&?' #'/&!' #'/?!' #'\*?' #'\*!' #'\~?' #'\~!' #'\<?' #'\<!' #'\>?' #'\>!' #'\=?' #'\=!' #'\@?' #'\@!' #'\,?' #'\,!' #'\%?' #'\%!' #'\|?' #'\|!' #'\&?' #'\&!' #'\?!' #'*~?' #'*~!' #'*<?' #'*<!' #'*>?' #'*>!' #'*=?' #'*=!' #'*@?' #'*@!' #'*,?' #'*,!' #'*%?' #'*%!' #'*|?' #'*|!' #'*&?' #'*&!' #'*?!' #'~<?' #'~<!' #'~>?' #'~>!' #'~=?' #'~=!' #'~@?' #'~@!' #'~,?' #'~,!' #'~%?' #'~%!' #'~|?' #'~|!' #'~&?' #'~&!' #'~?!' #'<>?' #'<>!' #'<=?' #'<=!' #'<@?' #'<@!' #'<,?' #'<,!' #'<%?' #'<%!' #'<|?' #'<|!' #'<&?' #'<&!' #'<?!' #'>=?' #'>=!' #'>@?' #'>@!' #'>,?' #'>,!' #'>%?' #'>%!' #'>|?' #'>|!' #'>&?' #'>&!' #'>?!' #'=@?' #'=@!' #'=,?' #'=,!' #'=%?' #'=%!' #'=|?' #'=|!' #'=&?' #'=&!' #'=?!' #'@,?' #'@,!' #'@%?' #'@%!' #'@|?' #'@|!' #'@&?' #'@&!' #'@?!' #',%?' #',%!' #',|?' #',|!' #',&?' #',&!' #',?!' #'%|?' #'%|!' #'%&?' #'%&!' #'%?!' #'|&?' #'|&!' #'|?!' #'&?!â)
may be this one #&?! is useful for WTF!
And because of that we sacrifice having nice method names! I really think that we should change that.
S.
On Wed, Sep 11, 2019 at 4:10 AM ducasse <stepharo@netcourrier.com> wrote:
On 11 Sep 2019, at 04:07, James Foster <Smalltalk@JGFoster.net> wrote:
Would use of ? and ! in unary/keyword selectors be convention or somehow required? If simply convention, then we should start with renaming testing methods to be named is* or has*. flag1 := anInteger even. ânot good" flag2 := anInteger isEven. âbetter" flag3 := anInteger even?. âhow much better?â flag4 := #(1 2 3) includes?: 2. âhow much better?â
I think that I would use ? mainly for unary message
Now Iâm sure that if you look carefully some people use
include for the action includes for the tests
I took include as an example and this is super not intention revealing.
lineUpBlockBrackets
lineUpBlockBrackets? Now I will rewrite them all as shouldLineUpBlockBrackets or isLineUpBlockBrackets and to me for unary message ? makes it a lot better.
Hi Stef, I have been facing this ambiguity a lot too. And my workaround, most of the times, was also to prefer the "question" method with #should. #is just doesn't sound right in my cases, but #should does sound good in most of them. I would still like to find a better one, but for the moment, in my recent years, I am stuck with #should. -- Mariano Martinez Peck Email: marianopeck@gmail.com Twitter: @MartinezPeck LinkedIn: www.linkedin.com/in/mariano-martinez-peck <https://www.linkedin.com/in/mariano-mart%C3%ADnez-peck/> Blog: https://marianopeck.wordpress.com/
+1 for #shouldXxx I recall I use it a lot too, and #isXxx where that reads better but am struggling for examples. Tim Sent from my iPhone
On 13 Sep 2019, at 02:37, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Wed, Sep 11, 2019 at 4:10 AM ducasse <stepharo@netcourrier.com> wrote:
On 11 Sep 2019, at 04:07, James Foster <Smalltalk@JGFoster.net> wrote:
Would use of ? and ! in unary/keyword selectors be convention or somehow required? If simply convention, then we should start with renaming testing methods to be named is* or has*. flag1 := anInteger even. ânot good" flag2 := anInteger isEven. âbetter" flag3 := anInteger even?. âhow much better?â flag4 := #(1 2 3) includes?: 2. âhow much better?â
I think that I would use ? mainly for unary message
Now Iâm sure that if you look carefully some people use
include for the action includes for the tests
I took include as an example and this is super not intention revealing.
lineUpBlockBrackets
lineUpBlockBrackets? Now I will rewrite them all as shouldLineUpBlockBrackets or isLineUpBlockBrackets and to me for unary message ? makes it a lot better.
Hi Stef,
I have been facing this ambiguity a lot too. And my workaround, most of the times, was also to prefer the "question" method with #should. #is just doesn't sound right in my cases, but #should does sound good in most of them. I would still like to find a better one, but for the moment, in my recent years, I am stuck with #should.
-- Mariano Martinez Peck Email: marianopeck@gmail.com Twitter: @MartinezPeck LinkedIn: www.linkedin.com/in/mariano-martinez-peck Blog: https://marianopeck.wordpress.com/
Some examples of testing methods verb prefixes I use: shouldXxx (#shouldOverwrite) isXxx (#isEmpty #isNil hasXxx (#hasContents) canXxx (#canDeleteProperty) usesXxx (#usesDirectTransfer) containsXxx (#containsPlots) definesXxx (#definesGlobals) didXxx (#didRemoveFiles) willXxx (#willCreateNewAssets) I'm in favor of having more symbols available as binary selectors, but I don't see the use of ? and ! as unary selectors other than the technical challenge of making the change, with the added burden of breaking compatibility. In a perfect world no testing is required and everything is solved by delegation, but we all know that sometimes the added complexity is not worth it. Regards, Esteban A. Maringolo On Fri, Sep 13, 2019 at 9:00 AM Tim Mackinnon <tim@testit.works> wrote:
+1 for #shouldXxx I recall I use it a lot too, and #isXxx where that reads better but am struggling for examples.
Tim
Sent from my iPhone
On 13 Sep 2019, at 02:37, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Wed, Sep 11, 2019 at 4:10 AM ducasse <stepharo@netcourrier.com> wrote:
On 11 Sep 2019, at 04:07, James Foster <Smalltalk@JGFoster.net> wrote:
Would use of ? and ! in unary/keyword selectors be convention or somehow required? If simply convention, then we should start with renaming testing methods to be named is* or has*. flag1 := anInteger even. ânot good" flag2 := anInteger isEven. âbetter" flag3 := anInteger even?. âhow much better?â flag4 := #(1 2 3) includes?: 2. âhow much better?â
I think that I would use ? mainly for unary message
Now Iâm sure that if you look carefully some people use
include for the action includes for the tests
I took include as an example and this is super not intention revealing.
lineUpBlockBrackets
lineUpBlockBrackets? Now I will rewrite them all as shouldLineUpBlockBrackets or isLineUpBlockBrackets and to me for unary message ? makes it a lot better.
Hi Stef,
I have been facing this ambiguity a lot too. And my workaround, most of the times, was also to prefer the "question" method with #should. #is just doesn't sound right in my cases, but #should does sound good in most of them. I would still like to find a better one, but for the moment, in my recent years, I am stuck with #should.
-- Mariano Martinez Peck Email: marianopeck@gmail.com Twitter: @MartinezPeck LinkedIn: www.linkedin.com/in/mariano-martinez-peck Blog: https://marianopeck.wordpress.com/
On 13 Sep 2019, at 14:11, Esteban Maringolo <emaringolo@gmail.com> wrote:
Some examples of testing methods verb prefixes I use:
shouldXxx (#shouldOverwrite) isXxx (#isEmpty #isNil hasXxx (#hasContents) canXxx (#canDeleteProperty)
didXxx (#didRemoveFiles) willXxx (#willCreateNewAssets)
this is for the following ones that I do not like that the only difference between an action and a question is an s
usesXxx (#usesDirectTransfer) containsXxx (#containsPlots) definesXxx (#definesGlobals)
I'm in favor of having more symbols available as binary selectors, but I don't see the use of ? and ! as unary selectors other than the technical challenge of making the change, with the added burden of breaking compatibility.
In a perfect world no testing is required and everything is solved by delegation, but we all know that sometimes the added complexity is not worth it.
:) If only For the pretty printer we have around 30 different parameters. I do not imagine my self having 30 classes to which I would delegate something.
Regards,
Esteban A. Maringolo
On Fri, Sep 13, 2019 at 9:00 AM Tim Mackinnon <tim@testit.works> wrote:
+1 for #shouldXxx I recall I use it a lot too, and #isXxx where that reads better but am struggling for examples.
Tim
Sent from my iPhone
On 13 Sep 2019, at 02:37, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Wed, Sep 11, 2019 at 4:10 AM ducasse <stepharo@netcourrier.com> wrote:
On 11 Sep 2019, at 04:07, James Foster <Smalltalk@JGFoster.net> wrote:
Would use of ? and ! in unary/keyword selectors be convention or somehow required? If simply convention, then we should start with renaming testing methods to be named is* or has*. flag1 := anInteger even. ânot good" flag2 := anInteger isEven. âbetter" flag3 := anInteger even?. âhow much better?â flag4 := #(1 2 3) includes?: 2. âhow much better?â
I think that I would use ? mainly for unary message
Now Iâm sure that if you look carefully some people use
include for the action includes for the tests
I took include as an example and this is super not intention revealing.
lineUpBlockBrackets
lineUpBlockBrackets? Now I will rewrite them all as shouldLineUpBlockBrackets or isLineUpBlockBrackets and to me for unary message ? makes it a lot better.
Hi Stef,
I have been facing this ambiguity a lot too. And my workaround, most of the times, was also to prefer the "question" method with #should. #is just doesn't sound right in my cases, but #should does sound good in most of them. I would still like to find a better one, but for the moment, in my recent years, I am stuck with #should.
-- Mariano Martinez Peck Email: marianopeck@gmail.com Twitter: @MartinezPeck LinkedIn: www.linkedin.com/in/mariano-martinez-peck Blog: https://marianopeck.wordpress.com/
On Wed, 11 Sep 2019 at 15:10, ducasse <stepharo@netcourrier.com> wrote:
On 11 Sep 2019, at 04:07, James Foster <Smalltalk@JGFoster.net> wrote:
Would use of ? and ! in unary/keyword selectors be convention or somehow required? If simply convention, then we should start with renaming testing methods to be named is* or has*. flag1 := anInteger even. ânot good"
Agreed. That could "almost" be construed as converting a 3 to a 2 or 4.
flag2 := anInteger isEven. âbetter"
Agreed. It reads well.
flag3 := anInteger even?. âhow much better?â
For me, this doesn't read as well as flag2, but even though there is some redundancy, for me a combination reads well... flag3a := anInteger isEven? Perhaps if "?"==>Boolean was a strong convention then there could be a check when the value is returned rather than when it is used (or would that complicate other things?)
flag4 := #(1 2 3) includes?: 2. âhow much better?â
My first impression is "yuck!", but then I think... "maybe" if there was a definite benefit (i.e. optimization) from strong guarantees about the return value being Boolean.
I think that I would use ? mainly for unary message
Now Iâm sure that if you look carefully some people use
include for the action includes for the tests
I took include as an example and this is super not intention revealing.
lineUpBlockBrackets
lineUpBlockBrackets? Now I will rewrite them all as shouldLineUpBlockBrackets or isLineUpBlockBrackets and to me for unary message ? makes it a lot better.
btw, some alternatives... doBlockBracketsLineUp - reads well but "do" is already a loaded word areBlockBracketsLinedUp - reads well with the past-tense phrasing cheers -ben
I agree with Benâs reaction below , however the point that ? ! could be repurposed for something if they werenât special characters is a good one. Maybe there are other usages we are missing, and thatâs the point I guess. Tim Sent from my iPhone
On 13 Sep 2019, at 17:41, Ben Coman <btc@openinworld.com> wrote:
On Wed, 11 Sep 2019 at 15:10, ducasse <stepharo@netcourrier.com> wrote:
On 11 Sep 2019, at 04:07, James Foster <Smalltalk@JGFoster.net> wrote:
Would use of ? and ! in unary/keyword selectors be convention or somehow required? If simply convention, then we should start with renaming testing methods to be named is* or has*. flag1 := anInteger even. ânot good"
Agreed. That could "almost" be construed as converting a 3 to a 2 or 4.
flag2 := anInteger isEven. âbetter"
Agreed. It reads well.
flag3 := anInteger even?. âhow much better?â
For me, this doesn't read as well as flag2, but even though there is some redundancy, for me a combination reads well... flag3a := anInteger isEven? Perhaps if "?"==>Boolean was a strong convention then there could be a check when the value is returned rather than when it is used (or would that complicate other things?)
flag4 := #(1 2 3) includes?: 2. âhow much better?â
My first impression is "yuck!", but then I think... "maybe" if there was a definite benefit (i.e. optimization) from strong guarantees about the return value being Boolean.
I think that I would use ? mainly for unary message
Now Iâm sure that if you look carefully some people use
include for the action includes for the tests
I took include as an example and this is super not intention revealing.
lineUpBlockBrackets
lineUpBlockBrackets? Now I will rewrite them all as shouldLineUpBlockBrackets or isLineUpBlockBrackets and to me for unary message ? makes it a lot better.
btw, some alternatives... doBlockBracketsLineUp - reads well but "do" is already a loaded word areBlockBracketsLinedUp - reads well with the past-tense phrasing
cheers -ben
On 13 Sep 2019, at 20:52, Tim Mackinnon <tim@testit.works> wrote:
I agree with Benâs reaction below , however the point that ? ! could be repurposed for something if they werenât special characters is a good one. Maybe there are other usages we are missing, and thatâs the point I guess.
Exactly. I think that it would be nice to think a bit. I like the idea that I do not have to read the code to understand if a method is a predicate. odd? even? Stef
Tim
Sent from my iPhone
On 13 Sep 2019, at 17:41, Ben Coman <btc@openinworld.com <mailto:btc@openinworld.com>> wrote:
On Wed, 11 Sep 2019 at 15:10, ducasse <stepharo@netcourrier.com <mailto:stepharo@netcourrier.com>> wrote:
On 11 Sep 2019, at 04:07, James Foster <Smalltalk@JGFoster.net <mailto:Smalltalk@JGFoster.net>> wrote:
Would use of ? and ! in unary/keyword selectors be convention or somehow required? If simply convention, then we should start with renaming testing methods to be named is* or has*. flag1 := anInteger even. ânot good"
Agreed. That could "almost" be construed as converting a 3 to a 2 or 4.
flag2 := anInteger isEven. âbetter"
Agreed. It reads well.
flag3 := anInteger even?. âhow much better?â
For me, this doesn't read as well as flag2, but even though there is some redundancy, for me a combination reads well... flag3a := anInteger isEven? Perhaps if "?"==>Boolean was a strong convention then there could be a check when the value is returned rather than when it is used (or would that complicate other things?)
flag4 := #(1 2 3) includes?: 2. âhow much better?â
My first impression is "yuck!", but then I think... "maybe" if there was a definite benefit (i.e. optimization) from strong guarantees about the return value being Boolean.
I think that I would use ? mainly for unary message
Now Iâm sure that if you look carefully some people use
include for the action includes for the tests
I took include as an example and this is super not intention revealing.
lineUpBlockBrackets
lineUpBlockBrackets? Now I will rewrite them all as shouldLineUpBlockBrackets or isLineUpBlockBrackets and to me for unary message ? makes it a lot better.
btw, some alternatives... doBlockBracketsLineUp - reads well but "do" is already a loaded word areBlockBracketsLinedUp - reads well with the past-tense phrasing
cheers -ben
Crazy idea inspired by Spanish: ¿even? On Sat, Sep 14, 2019 at 04:38 ducasse <stepharo@netcourrier.com> wrote:
On 13 Sep 2019, at 20:52, Tim Mackinnon <tim@testit.works> wrote:
I agree with Benâs reaction below , however the point that ? ! could be repurposed for something if they werenât special characters is a good one. Maybe there are other usages we are missing, and thatâs the point I guess.
Exactly. I think that it would be nice to think a bit. I like the idea that I do not have to read the code to understand if a method is a predicate.
odd? even?
Stef
Tim
Sent from my iPhone
On 13 Sep 2019, at 17:41, Ben Coman <btc@openinworld.com> wrote:
On Wed, 11 Sep 2019 at 15:10, ducasse <stepharo@netcourrier.com> wrote:
On 11 Sep 2019, at 04:07, James Foster <Smalltalk@JGFoster.net> wrote:
Would use of ? and ! in unary/keyword selectors be convention or somehow required? If simply convention, then we should start with renaming testing methods to be named is* or has*. flag1 := anInteger even. ânot good"
Agreed. That could "almost" be construed as converting a 3 to a 2 or 4.
flag2 := anInteger isEven. âbetter"
Agreed. It reads well.
flag3 := anInteger even?. âhow much better?â
For me, this doesn't read as well as flag2, but even though there is some redundancy, for me a combination reads well... flag3a := anInteger isEven? Perhaps if "?"==>Boolean was a strong convention then there could be a check when the value is returned rather than when it is used (or would that complicate other things?)
flag4 := #(1 2 3) includes?: 2. âhow much better?â
My first impression is "yuck!", but then I think... "maybe" if there was a definite benefit (i.e. optimization) from strong guarantees about the return value being Boolean.
I think that I would use ? mainly for unary message
Now Iâm sure that if you look carefully some people use
include for the action includes for the tests
I took include as an example and this is super not intention revealing.
lineUpBlockBrackets
lineUpBlockBrackets? Now I will rewrite them all as shouldLineUpBlockBrackets or isLineUpBlockBrackets and to me for unary message ? makes it a lot better.
btw, some alternatives... doBlockBracketsLineUp - reads well but "do" is already a loaded word areBlockBracketsLinedUp - reads well with the past-tense phrasing
cheers -ben
--
Christopher Fuhrman, P.Eng., PhD *Professeur au Département de génie logiciel et des technologies de l'informationÃTS (Ãcole de technologie supérieure)* http://profs.etsmtl.ca/cfuhrman +1 514 396 8638 *L'ÃTS est une constituante de l'Université du Québec*
areBlockBracketsLinedUp - reads well with the past-tense phrasing
Technically, that is in present tense but using the passive voice. Passive voice is used to emphasize who receives an action, instead of who performs the action. El sáb., 14 sept. 2019 a las 16:07, Christopher Fuhrman (< christopher.fuhrman@etsmtl.ca>) escribió:
Crazy idea inspired by Spanish:
¿even?
On Sat, Sep 14, 2019 at 04:38 ducasse <stepharo@netcourrier.com> wrote:
On 13 Sep 2019, at 20:52, Tim Mackinnon <tim@testit.works> wrote:
I agree with Benâs reaction below , however the point that ? ! could be repurposed for something if they werenât special characters is a good one. Maybe there are other usages we are missing, and thatâs the point I guess.
Exactly. I think that it would be nice to think a bit. I like the idea that I do not have to read the code to understand if a method is a predicate.
odd? even?
Stef
Tim
Sent from my iPhone
On 13 Sep 2019, at 17:41, Ben Coman <btc@openinworld.com> wrote:
On Wed, 11 Sep 2019 at 15:10, ducasse <stepharo@netcourrier.com> wrote:
On 11 Sep 2019, at 04:07, James Foster <Smalltalk@JGFoster.net> wrote:
Would use of ? and ! in unary/keyword selectors be convention or somehow required? If simply convention, then we should start with renaming testing methods to be named is* or has*. flag1 := anInteger even. ânot good"
Agreed. That could "almost" be construed as converting a 3 to a 2 or 4.
flag2 := anInteger isEven. âbetter"
Agreed. It reads well.
flag3 := anInteger even?. âhow much better?â
For me, this doesn't read as well as flag2, but even though there is some redundancy, for me a combination reads well... flag3a := anInteger isEven? Perhaps if "?"==>Boolean was a strong convention then there could be a check when the value is returned rather than when it is used (or would that complicate other things?)
flag4 := #(1 2 3) includes?: 2. âhow much better?â
My first impression is "yuck!", but then I think... "maybe" if there was a definite benefit (i.e. optimization) from strong guarantees about the return value being Boolean.
I think that I would use ? mainly for unary message
Now Iâm sure that if you look carefully some people use
include for the action includes for the tests
I took include as an example and this is super not intention revealing.
lineUpBlockBrackets
lineUpBlockBrackets? Now I will rewrite them all as shouldLineUpBlockBrackets or isLineUpBlockBrackets and to me for unary message ? makes it a lot better.
btw, some alternatives... doBlockBracketsLineUp - reads well but "do" is already a loaded word areBlockBracketsLinedUp - reads well with the past-tense phrasing
cheers -ben
--
Christopher Fuhrman, P.Eng., PhD
*Professeur au Département de génie logiciel et des technologies de l'informationÃTS (Ãcole de technologie supérieure)*
http://profs.etsmtl.ca/cfuhrman +1 514 396 8638 *L'ÃTS est une constituante de l'Université du Québec*
participants (14)
-
Ben Coman -
Bernardo Ezequiel Contreras -
Christopher Fuhrman -
ducasse -
Esteban Maringolo -
Gabriel Cotelli -
James Foster -
Mariano Martinez Peck -
Nicolas Cellier -
phil@highoctane.be -
Ronie Salgado -
Serge Stinckwich -
Sven Van Caekenberghe -
Tim Mackinnon