Re: renaming or adding some operators

2009-05-31 Thread John M. Dlugosz
Brandon S. Allbery KF8NH allbery-at-ece.cmu.edu |Perl 6| wrote: ⨷ perhaps? It only makes sense that a Unicode operator be used to pull in all of Unicode. Bravo. If you can't type that, you won't find it useful!

Re: renaming or adding some operators

2009-05-31 Thread Brandon S. Allbery KF8NH
On May 30, 2009, at 15:38 , Larry Wall wrote: Perhaps something like use *; should pull in all the Unicode operators. Which if course means that any golfing would start with *; ⨷ perhaps? It only makes sense that a Unicode operator be used to pull in all of Unicode. -- brandon s

Re: renaming or adding some operators

2009-05-31 Thread Brandon S. Allbery KF8NH
On May 29, 2009, at 22:33 , Jon Lang wrote: "also" is an ordered, short-circuiting version of "&" (and thus "all"). For some time now, I've wanted an analog for '|' and 'any' - but the only name I can think of for it would be 'else', which has some obvious clarity issues. I have seen "x (alt.

Re: renaming or adding some operators

2009-05-30 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: Indeed, getting "close enough" is one of the underlying design themes of Perl 6. As to whether we're close to do the operator aliasing in a mostly digraphic fashion, I'm not sure. Currently a macro for an infix would be given the AST of the left argu

Re: renaming or adding some operators

2009-05-30 Thread Larry Wall
On Sat, May 30, 2009 at 04:50:02PM -0500, John M. Dlugosz wrote: > Note that ≥ and ≤ are "bidi mirroring" characters in the Unicode > Properties. So if someone were crazy enough to use them as brackets, > then the digraph equivalent should work as well, right? No, they'd only function as digr

Re: renaming or adding some operators

2009-05-30 Thread John M. Dlugosz
David Green david.green-at-telus.net |Perl 6| wrote: On 2009-May-29, at 7:53 pm, Darren Duncan wrote: Thirdly, there are I'm sure a number of other aliases that could be added to other ops, such as ≤ and ≥ for <= and >=, and ≠ for one of the inequality operators, although that last one would pr

Re: renaming or adding some operators

2009-05-30 Thread Larry Wall
On Sat, May 30, 2009 at 01:09:01PM -0600, David Green wrote: > I think that one's ambiguous as to whether $bar exists as a key or a > value. > > $bar ∈ @foo; $bar ∈ %foo.keys; $bar ∈ %foo.values; ∃ %foo{bar} Generally when hashes have been used as sets we've taken the keys to be the set, not th

Re: renaming or adding some operators

2009-05-30 Thread Larry Wall
It occurs to me that, while I don't want to pull in all the possible Unicode operators by default, we should make it easy to do so. Perhaps something like use *; should pull in all the Unicode operators. Which if course means that any golfing would start with *; to pull in all the pos

Re: renaming or adding some operators

2009-05-30 Thread David Green
On 2009-May-29, at 7:53 pm, Darren Duncan wrote: Thirdly, there are I'm sure a number of other aliases that could be added to other ops, such as ≤ and ≥ for <= and >=, and ≠ for one of the inequality operators, although that last one would probably make more sense if = was the equality test

Re: renaming or adding some operators

2009-05-30 Thread darren
John M. Dlugosz said [off-list]: > Darren Duncan darren-at-darrenduncan.net |Perl 6| wrote: >> I also know that >> given its current design, === and !=== just happen to have the same >> semantics as logical xnor and xor when given 2 Bool inputs, and so >> they serve the purpose. Having distinct xn

Re: renaming or adding some operators

2009-05-30 Thread Larry Wall
On Fri, May 29, 2009 at 08:45:06PM -0700, Darren Duncan wrote: > So does anyone else have thoughts on that? Actually, I think ~x is kinda ugly. And I like the mnemonic value of x returning one thing and xx returning multiple things. And in the bitwise ops ~ doesn't indicate postprocessing. And

Re: renaming or adding some operators

2009-05-30 Thread Larry Wall
On Fri, May 29, 2009 at 11:06:46PM -0700, Darren Duncan wrote: > Larry, did you choose = for assignment and == etc for comparison because > you thought that looked prettier, or because that was the C/etc > convention that you decided to copy? Neither beauty nor convention, really. I chose it fo

Re: renaming or adding some operators

2009-05-30 Thread Darren Duncan
John M. Dlugosz wrote: Your nomenclature makes me think you are coming from an APL background. Actually, I've never used APL. The main influences for the terminology I use, besides Perl which is my favorite general purpose language, is the field of relational databases, both the SQL language

Re: renaming or adding some operators

2009-05-30 Thread John M. Dlugosz
Thoughts: Your nomenclature makes me think you are coming from an APL background. !=== is already generated from ===, and compares the identity of any two objects. It works on binary values since they are value types, but that's not the "proper" usage, and Perl separates out the concerns. S

Re: renaming or adding some operators

2009-05-29 Thread Carl Mäsak
Darren (>): > Firstly, regarding the string replication ops as documented in Synopsis 3, > 'x' and 'xx', I'm wondering whether it might be better to have something > that incorporates a '~', since that operation is about catenation. > > Would perhaps '~*' work better than 'x' to signify better what

Re: renaming or adding some operators

2009-05-29 Thread Darren Duncan
Buddha Buck wrote: Secondly, regarding the Bool type, I think it would be useful for Perl 6 to define the full complement of dyadic logical operators, of which I count a few that you don't appear to already have. Probably the best place is in Synopsis 32. There are 16 dyadic logical operators,

Re: renaming or adding some operators

2009-05-29 Thread Timothy S. Nelson
On Fri, 29 May 2009, Darren Duncan wrote: Timothy S. Nelson wrote: How about if xx became x, and then we did things like: [~] @list x $count ...to get the string replciation? Maybe you meant this? [~] $item x $count No, I'm pretty sure I meant what I wrote. But if x coerce

Re: renaming or adding some operators

2009-05-29 Thread Jon Lang
Darren Duncan wrote: >> Side note: one thing that I recently learned concerning implication >> operators is that the direction of the implication doesn't necessarily >> follow the direction of the arrow.  In particular, "A if B" is "A←B", >> and "A only if B" is "A→B": in both of the original state

Re: renaming or adding some operators

2009-05-29 Thread Darren Duncan
Timothy S. Nelson wrote: How about if xx became x, and then we did things like: [~] @list x $count ...to get the string replciation? Maybe you meant this? [~] $item x $count I like that a lot. And we could still have ~x as a shorthand for that specific case since it would li

Re: renaming or adding some operators

2009-05-29 Thread Darren Duncan
Jon Lang wrote: I wouldn't mind 'x' becoming '~x' and 'xx' becoming 'x'; it strikes me as a lot more intuitive - and I've wanted to see this done for a while now. I suppose that you might also introduce a '?x' and/or a '+x' to complete the set, though for the life of me I can't think of how they

Re: renaming or adding some operators

2009-05-29 Thread Timothy S. Nelson
On Fri, 29 May 2009, Jon Lang wrote: On Fri, May 29, 2009 at 6:53 PM, Darren Duncan wrote: I had some thoughts lately about the Perl 6 operators, and wanted to bounce some ideas. Firstly, regarding the string replication ops as documented in Synopsis 3, 'x' and 'xx', I'm wondering w