Re: Numeric Semantics

2007-01-24 Thread Nicholas Clark
On Mon, Jan 22, 2007 at 05:56:46PM -0800, Larry Wall wrote: > The default / operator is not going to do integer division. This is > not negotiable; normal people expect 1/2 to mean one half, so / is > going to coerce to some type that can support fractions. We'll use I agree. And I hope I count

Re: Smooth or Chunky?

2007-01-24 Thread Austin Frank
On Tue, Jan 23 2007, Larry Wall wrote: > ... Basically, this is the inverse of [;], which turns LoA into a > CoC. > > [;] chunky mumble() > > But "chunky" is clunky, and I'm wondering what syntactic relief we > can give ourselves here. ... > > (That almost suggests it should be another metaope

Re: Smooth or Chunky?

2007-01-24 Thread Blair Sutton
Just some ideas for multidimensional map. map { $_, $_ * 10 }, 1..3 1,10, 2,20, 3,30 map { $_, $_ * 10 }, 1..3 [1,10], [2,20], [3,30] map { $_[0], $_[1] * 10 }, 1..3, 3..4 1,30, 2,40, 3,undef or better maybe 1,30, 2,40, 3 map { $_[0], $_[1] * 10 }, 1..3, 2..3, 3 op => [] [1,2,3], [2,3,undef

Re: Numeric Semantics

2007-01-24 Thread Smylers
TSa writes: > Smylers wrote: > > > I'd much prefer for introductory Perl books not to have to explain > > what "Euclidean" means. > > Yeah, it will not dive into the exact reasons why the floor > definition was chosen, either. Sure, if we _only_ have floor (or indeed if we _only_ have one of th

Re: Numeric Semantics

2007-01-24 Thread TSa
HaloO, Smylers wrote: Do you think most Perl programmers appreciate the difference, or are likely to need both sorts frequently? I guess not. I'd much prefer for introductory Perl books not to have to explain what "Euclidean" means. Yeah, it will not dive into the exact reasons why the f

Re: Numeric Semantics

2007-01-24 Thread TSa
HaloO, Larry Wall wrote: Well, mostly, unless we consider that Num(1.0) might have to wait till run time to know what conversion to Num actually means, if Num is sufficiently delegational But I think the compiler can probably require a tighter definition of basic types for optimization purp

Re: Numeric Semantics

2007-01-24 Thread Smylers
TSa writes: > Larry Wall wrote: > > > The default / operator is not going to do integer division. [..] And > > % should stick to standard floor semantics, I expect. > > Since the latin1 charset contains the division character ÷ we could > use that to mean floor based integer division and % the f

Re: Numeric Semantics

2007-01-24 Thread TSa
HaloO, Larry Wall wrote: The default / operator is not going to do integer division. [..] And % should stick to standard floor semantics, I expect. Since the latin1 charset contains the division character ÷ we could use that to mean floor based integer division and % the floor based modulus. T

Re: Numeric Semantics

2007-01-24 Thread TSa
HaloO, Larry Wall wrote: For various practical reasons I don't think we can treat Int as a subset of Num, especially if Num is representing any of several approximating types that may or may not have the "headroom" for arbitrary integer math, or that lose low bits in the processing of gaining hi

Re: Smooth or Chunky?

2007-01-24 Thread Ruud H.G. van Tol
Larry Wall schreef: > the point is *not* to force it one way or the other--the point is > that many such functions would probably prefer not to commit one way > or the other, and they can't do that if they automatically throw away > the "dimensional" information. Like with numbers, this looks to

Re: Smooth or Chunky?

2007-01-24 Thread Ben Morrow
Quoth [EMAIL PROTECTED] (Larry Wall): > I should also mention I did (briefly) consider the "null" reduce > operator: > > [] zip(1,2;3,4) > > to mean "slap [] around each element", but it runs into ambiguity with > the existing [] form indicating an empty list. Would using [[]] instead work?