[squeak-dev] The Inbox: Kernel-fn.1151.mcz

Tobias Pape Das.Linux at gmx.de
Fri Feb 9 18:50:43 UTC 2018


> On 09.02.2018, at 19:47, Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com> wrote:
> 
> 
> 
> 2018-02-09 19:35 GMT+01:00 Tobias Pape <Das.Linux at gmx.de>:
> 
> > On 09.02.2018, at 19:06, Fabio Niephaus <lists at fniephaus.com> wrote:
> >
> > On Fri, Feb 9, 2018 at 6:31 PM Chris Cunningham <cunningham.cb at gmail.com> wrote:
> > #xor: is on the same plane as #| and #& - evaluate both sides and apply
> >
> > We also have #and: and #or: - evaluate receiver, and evaluate argument block if and only if necessary.
> >
> > I use #and: and #or: for speed purposes - and to avoid side effects (sometimes).
> >
> > I'm just curious - is there an equivalent symbol for xor similar to | and & that we could use?
> >
> > In some languages, they use ^ but for obvious reason that's not useful. I wonder if we could use ~ for #xor:?
> 
> Wikipedia says:
> 
> "It is symbolized by the prefix operator J[2] and by the infix operators XOR (/ˌɛks ˈɔːr/), EOR, EXOR, ⊻, ⩒, ⩛, ⊕, ↮, and ≢. "
> 
> Theoretically, we could use any of these symbols, (⊕ is often used in maths) but our fonts don't display them yet, so that has to wait.
> 
> Further there:
> 
>         "+, a plus sign", well, would work (on booleans) but could be confusing
>         "J, as in Jpq", not working for us
> 
>         ", sometimes written as
>         • ><
>         • >-<"
> 
>         THAT could work.
> 
> I like
> 
>         a >< b
> 
> it looks like an X a bit.
> 
> Best regards
>         -Tobias
> 
> Nice.
> We could also note or as union a\/b, and as intersection a/\b but it's too late to change this.
> Anyway, given the number of senders of xor:, I'm not convinced that we need a binary message.
> We also have a pair of binary messages that already works: ~= or even ~~

True. We often forget this simplicity…


> 
> 
> 
> 
> PS: GMail/Inbox apparently destroys the citation level :(
> 
> >
> >
> > Also, before making this change to using blocks (if we do), we'd need to fix all users - probably also in the VMMaker packages.
> >
> > Right...fortunately, there aren't that many senders...
> >
> > Fabio
> >
> >
> > -cbc
> >
> > On Fri, Feb 9, 2018 at 9:18 AM, Levente Uzonyi <leves at caesar.elte.hu> wrote:
> > On Fri, 9 Feb 2018, marcel.taeumel wrote:
> >
> > commits-2 wrote
> > A new version of Kernel was added to project The Inbox:
> > http://source.squeak.org/inbox/Kernel-fn.1151.mcz
> >
> > ==================== Summary ====================
> >
> > Name: Kernel-fn.1151
> > Author: fn
> > Time: 9 February 2018, 12:32:25.516883 pm
> > UUID: 9fb7df4b-6bf4-4af8-9c75-7496c2f0b517
> > Ancestors: Kernel-tonyg.1150
> >
> > For consistency: allow blocks to be passed into #xor: (see #or: and
> > #and:).
> >
> > =============== Diff against Kernel-tonyg.1150 ===============
> >
> > Item was changed:
> >  ----- Method: False>>xor: (in category 'logical operations') -----
> > + xor: alternativeBlock
> > - xor: aBoolean
> >        "Posted by Eliot Miranda to squeak-dev on 3/24/2009"
> >
> > +       ^alternativeBlock value!
> > -       ^aBoolean!
> >
> > Item was changed:
> >  ----- Method: True>>xor: (in category 'logical operations') -----
> > + xor: alternativeBlock
> > - xor: aBoolean
> >        "Posted by Eliot Miranda to squeak-dev on 3/24/2009"
> >
> > +       ^alternativeBlock value not!
> > -       ^aBoolean not!
> >
> > Hey Nicolas,
> >
> > it seems that you had the intention to not allow "a xor: [b]" because,
> > obviously, one does always have to check both operands for XOR. Yet, would
> > it do any harm if we would allow "a xor: [b]"?
> >
> > Performance. Two fold: you create a block for no reason, because it will always be evaluated right after its creation.
> > If there is no block, #value still has to be sent.
> >
> > Levente
> >
> >
> >
> > Best,
> > Marcel
> >
> >
> >
> > --
> > Sent from: http://forum.world.st/Squeak-Dev-f45488.html
> >
> >
> >
> >



More information about the Squeak-dev mailing list