Re: Suggested magic for a .. b

2010-07-28 Thread Michael Zedeler
On 2010-07-28 06:54, Martin D Kealey wrote: On Wed, 28 Jul 2010, Michael Zedeler wrote: Writing for ($a .. $b).reverse - $c { ...} may then blow up because it turns out that $b doesn't have a .succ method when coercing to sequence (where the LHS must have an initial value), just like

Re: Suggested magic for a .. b

2010-07-28 Thread Darren Duncan
Michael Zedeler wrote: This is exactly why I keep writing posts about Ranges being defunct as they have been specified now. If we accept the premise that Ranges are supposed to define a kind of linear membership specification between two starting points (as in math), it doesn't make sense that

Re: Suggested magic for a .. b

2010-07-28 Thread Dave Whipp
Michael Zedeler wrote: This is exactly why I keep writing posts about Ranges being defunct as they have been specified now. If we accept the premise that Ranges are supposed to define a kind of linear membership specification between two starting points (as in math), it doesn't make sense

Re: Suggested magic for a .. b

2010-07-28 Thread Jon Lang
Dave Whipp wrote: To squint at this slightly, in the context that we already have 0...1e10 as a sequence generator, perhaps the semantics of iterating a range should be unordered -- that is,  for 0..10 - $x { ... } is treated as  for (0...10).pick(*) - $x { ... } Then the whole question

Re: Suggested magic for a .. b

2010-07-28 Thread Moritz Lenz
Dave Whipp wrote: To squint at this slightly, in the context that we already have 0...1e10 as a sequence generator, perhaps the semantics of iterating a range should be unordered -- that is, for 0..10 - $x { ... } is treated as for (0...10).pick(*) - $x { ... } Sorry, I have

Re: Suggested magic for a .. b

2010-07-28 Thread yary
On Wed, Jul 28, 2010 at 8:34 AM, Dave Whipp d...@dave.whipp.name wrote: To squint at this slightly, in the context that we already have 0...1e10 as a sequence generator, perhaps the semantics of iterating a range should be unordered -- that is, for 0..10 - $x { ... } is treated as for

Re: Suggested magic for a .. b

2010-07-28 Thread Moritz Lenz
yary wrote: though would a parallel batch of an anonymous block be more naturally written as all(0...10) - $x { ... } # Spawn 11 threads No, hyper for 0..10 - $x { ... } # spawn as many threads # as the compiler thinks are reasonable I think one (already specced) syntax for the

Re: Suggested magic for a .. b

2010-07-28 Thread TSa (Thomas Sandlaß)
On Wednesday, 28. July 2010 05:12:52 Michael Zedeler wrote: Writing ($a .. $b).reverse doesn't make any sense if the result were a new Range, since Ranges should then only be used for inclusion tests (so swapping endpoints doesn't have any meaningful interpretation), but applying .reverse

Re: Suggested magic for a .. b

2010-07-28 Thread yary
Swapping the endpoints could mean swapping inside test to outside test. The only thing that is needed is to swap from to ||: $a .. $b # means $a = $_ $_ = $b if $a $b $b .. $a # means $b = $_ || $_ = $a if $a $b I think that's what not, ! are for!

Re: Suggested magic for a .. b

2010-07-28 Thread Jon Lang
TSa wrote: Swapping the endpoints could mean swapping inside test to outside test. The only thing that is needed is to swap from to ||:   $a .. $b   # means  $a = $_ $_ = $b  if $a $b   $b .. $a   # means  $b = $_ || $_ = $a  if $a $b This is the same sort of discontinuity of meaning

Re: Suggested magic for a .. b

2010-07-28 Thread Mark J. Reed
On Wednesday, July 28, 2010, Jon Lang datawea...@gmail.com wrote: Keep it simple, folks!  There are enough corner cases in Perl 6 as things stand; we don't need to be introducing more of them if we can help it. Can I get an Amen? Amen! -- Mark J. Reed markjr...@gmail.com

Re: Suggested magic for a .. b

2010-07-28 Thread Mark J. Reed
On Wed, Jul 28, 2010 at 2:30 PM, Chris Fields cjfie...@illinois.edu wrote: On Jul 28, 2010, at 1:27 PM, Mark J. Reed wrote: Can I get an Amen?  Amen! -- Mark J. Reed markjr...@gmail.com +1.  I'm agnostic ; Militant? :) ( http://tinyurl.com/3xjgxnl ) Nothing inherently religious about

Re: Suggested magic for a .. b

2010-07-28 Thread Dave Whipp
Moritz Lenz wrote: Dave Whipp wrote: for 0..10 - $x { ... } is treated as for (0...10).pick(*) - $x { ... } Sorry, I have to ask. Are you serious? Really? Ah, to reply, or not to reply, to rhetorical sarcasm ... In this case, I think I will: Was my specific proposal entirely

Re: Suggested magic for a .. b

2010-07-28 Thread Moritz Lenz
Dave Whipp wrote: Moritz Lenz wrote: Dave Whipp wrote: for 0..10 - $x { ... } is treated as for (0...10).pick(*) - $x { ... } Sorry, I have to ask. Are you serious? Really? Ah, to reply, or not to reply, to rhetorical sarcasm ... In this case, I think I will: No sarcasm

Re: Suggested magic for a .. b

2010-07-28 Thread Dave Whipp
Moritz Lenz wrote: I fear what Perl 6 needs is not to broaden the range of discussion even further, but to narrow it down to the essential points. Personal opinion only. OK, as a completely serious proposal, the semantics of for 0..10 { ... } should be for the compiler to complain sorry,

Re: Suggested magic for a .. b

2010-07-28 Thread Aaron Sherman
On Wed, Jul 28, 2010 at 11:34 AM, Dave Whipp d...@dave.whipp.name wrote: To squint at this slightly, in the context that we already have 0...1e10 as a sequence generator, perhaps the semantics of iterating a range should be unordered -- that is, for 0..10 - $x { ... } is treated as for

Re: Suggested magic for a .. b

2010-07-28 Thread yary
On Wed, Jul 28, 2010 at 2:29 PM, Aaron Sherman a...@ajs.com wrote: The more I look at this, the more I think .. and ... are reversed. .. has a very specific and narrow usage (comparing ranges) and ... is probably going to be the most broadly used operator in the language outside of quotes,

Re: Suggested magic for a .. b

2010-07-28 Thread Leon Timmermans
On Wed, Jul 28, 2010 at 11:29 PM, Aaron Sherman a...@ajs.com wrote: The more I look at this, the more I think .. and ... are reversed. .. has a very specific and narrow usage (comparing ranges) and ... is probably going to be the most broadly used operator in the language outside of quotes,

Re: Suggested magic for a .. b

2010-07-28 Thread Darren Duncan
Aaron Sherman wrote: The more I look at this, the more I think .. and ... are reversed. .. has a very specific and narrow usage (comparing ranges) and ... is probably going to be the most broadly used operator in the language outside of quotes, commas and the basic, C-derived math and logic ops.

Re: Suggested magic for a .. b

2010-07-28 Thread Darren Duncan
Darren Duncan wrote: Aaron Sherman wrote: The more I look at this, the more I think .. and ... are reversed. snip I would rather that .. stay with intervals and ... with generators. snip Another thing to consider if one is looking at huffmanization is how often the versions that exclude

Re: Suggested magic for a .. b

2010-07-28 Thread Dave Whipp
Aaron Sherman wrote: On Wed, Jul 28, 2010 at 11:34 AM, Dave Whipp d...@dave.whipp.name wrote: To squint at this slightly, in the context that we already have 0...1e10 as a sequence generator, perhaps the semantics of iterating a range should be unordered -- that is, for 0..10 - $x { ... }

Re: Suggested magic for a .. b

2010-07-28 Thread Darren Duncan
Dave Whipp wrote: Similarly (0..1).Seq should most likely return Real numbers No it shouldn't, because the endpoints are integers. If you want Real numbers, then say 0.0 .. 1.0 instead. -- Darren Duncan

Re: Suggested magic for a .. b

2010-07-28 Thread Dave Whipp
Darren Duncan wrote: Dave Whipp wrote: Similarly (0..1).Seq should most likely return Real numbers No it shouldn't, because the endpoints are integers. If you want Real numbers, then say 0.0 .. 1.0 instead. -- Darren Duncan That would be inconsistent. $x ~~ 0..1 means 0 = $x = 1. The fact

Re: Suggested magic for a .. b

2010-07-28 Thread Aaron Sherman
On Wed, Jul 28, 2010 at 6:24 PM, Dave Whipp d...@dave.whipp.name wrote: Aaron Sherman wrote: On Wed, Jul 28, 2010 at 11:34 AM, Dave Whipp d...@dave.whipp.name wrote: To squint at this slightly, in the context that we already have 0...1e10 as a sequence generator, perhaps the semantics of

Re: Suggested magic for a .. b

2010-07-28 Thread Aaron Sherman
On Wed, Jul 28, 2010 at 6:24 PM, Dave Whipp d...@dave.whipp.name wrote: Aaron Sherman wrote: On Wed, Jul 28, 2010 at 11:34 AM, Dave Whipp d...@dave.whipp.name wrote: To squint at this slightly, in the context that we already have 0...1e10 as a sequence generator, perhaps the semantics of

Re: Suggested magic for a .. b

2010-07-28 Thread Jon Lang
Darren Duncan wrote: Does ... also come with the 4 variations of endpoint inclusion/exclusion? If not, then it should, as I'm sure many times one would want to do this, say:  for 0...^$n - {...} You can toggle the inclusion/exclusion of the ending condition by choosing between ... and ...^;

Re: Suggested magic for a .. b

2010-07-28 Thread Jon Lang
Aaron Sherman wrote: In smart-match context, a..b includes aardvark. No one has yet explained to me why that makes sense. The continued use of ASCII examples, of course, doesn't help. Does a .. b include æther? This is where Germans and Swedes, for example, don't agree, but they're all

Re: Suggested magic for a .. b

2010-07-28 Thread Michael Zedeler
On 2010-07-29 00:24, Dave Whipp wrote: Aaron Sherman wrote: On Wed, Jul 28, 2010 at 11:34 AM, Dave Whipp d...@dave.whipp.name wrote: To squint at this slightly, in the context that we already have 0...1e10 as a sequence generator, perhaps the semantics of iterating a range should be

Re: Suggested magic for a .. b

2010-07-28 Thread Michael Zedeler
On 2010-07-29 01:39, Jon Lang wrote: Aaron Sherman wrote: In smart-match context, a..b includes aardvark. No one has yet explained to me why that makes sense. The continued use of ASCII examples, of course, doesn't help. Does a .. b include æther? This is where Germans and Swedes, for

Re: Suggested magic for a .. b

2010-07-28 Thread Jon Lang
Michael Zedeler wrote: Jon Lang wrote: This is definitely something for the Unicode crowd to look into.  But whatever solution you come up with, please make it compatible with the notion that aardvark..apple can be used to match any word in the dictionary that comes between those two words.

Re: Suggested magic for a .. b

2010-07-28 Thread Chris Fields
On Jul 28, 2010, at 1:37 PM, Mark J. Reed wrote: On Wed, Jul 28, 2010 at 2:30 PM, Chris Fields cjfie...@illinois.edu wrote: On Jul 28, 2010, at 1:27 PM, Mark J. Reed wrote: Can I get an Amen? Amen! -- Mark J. Reed markjr...@gmail.com +1. I'm agnostic ; Militant? :) (

Re: Suggested magic for a .. b

2010-07-28 Thread Chris Fields
On Jul 28, 2010, at 1:27 PM, Mark J. Reed wrote: On Wednesday, July 28, 2010, Jon Lang datawea...@gmail.com wrote: Keep it simple, folks! There are enough corner cases in Perl 6 as things stand; we don't need to be introducing more of them if we can help it. Can I get an Amen? Amen! --

Re: Suggested magic for a .. b

2010-07-28 Thread Michael Zedeler
On 2010-07-29 02:19, Jon Lang wrote: Michael Zedeler wrote: Jon Lang wrote: This is definitely something for the Unicode crowd to look into. But whatever solution you come up with, please make it compatible with the notion that aardvark..apple can be used to match any word in the

Re: Suggested magic for a .. b

2010-07-28 Thread Darren Duncan
Jon Lang wrote: I don't know enough about Unicode to suggest how to solve this. All I can say is that my example above should never return a valid Range object unless there is a way I can specify my own ordering and I use it. That actually says something: it says that we may want to reconsider

Re: Suggested magic for a .. b

2010-07-28 Thread Brandon S Allbery KF8NH
On 7/28/10 8:07 PM, Michael Zedeler wrote: On 2010-07-29 01:39, Jon Lang wrote: Aaron Sherman wrote: In smart-match context, a..b includes aardvark. No one has yet explained to me why that makes sense. The continued use of ASCII examples, of course, doesn't help. Does a .. b include æther?