Re: push with lazy lists

2004-07-16 Thread Jonadab the Unsightly One
Austin Hastings [EMAIL PROTECTED] writes:

 Half of all numbers in [0, Inf) are in the range [Inf/2, Inf). Which
 collapses to the range [Inf, Inf). 

It's not that simple.  By that reasoning, 10% of all numbers in
[0,Inf) would be in [Inf/10,Inf), also reducing to the range
[Inf,Inf).  For that matter, 99% of them would be in [Inf/100,Inf),
which would reduce to [Inf,Inf).  But you can't do that kind of
arithmetic with Inf.  You're trying to pretend you're working with a
natural number or a specific real, when in fact it's a cardinality (or
a class of cardinalities, or an infinite set of cardinalities, or
something along those lines).  If you want to do addition and
multiplication on Inf, you have to redefine addition and
multiplication to get away from the CPU's finite arithmetic, and you'd
also need to treat Inf more completely than Perl does.  (Perl treats
all infinities as the same, which is (mathematically speaking)
patently rediculous, because for practical purposes it never matters
to most software, and if somebody wants to clone Mathematica they'll
be writing their own math library anyway.)

It would be *nice* to have this stuff properly supported in a
programming language, sure, but it would also be a ton of work and can
probably wait for at least Perl7.

Oh, and the hardware available to most folks isn't up to the challenge
of picking a properly random number between 0 and Inf yet, either.
Most of the time it wouldn't fit in RAM.  Predicting when this
challenge will be overcome is left as an exercise to the reader.

-- 
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b-()}}
split//,[EMAIL PROTECTED]/ --;$\=$ ;- ();print$/



Re: push with lazy lists

2004-07-16 Thread Jonadab the Unsightly One
David Storrs [EMAIL PROTECTED] writes:

 Does it even make sense to take the Infiniteth element of an array?

No.  At best, it would be undefined, so we could define it to return
undef.

 I think I would prefer if using Inf as an array index resulted in a
 trappable error.

Or that, yeah.

-- 
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b-()}}
split//,[EMAIL PROTECTED]/ --;$\=$ ;- ();print$/



Re: push with lazy lists

2004-07-16 Thread Jonadab the Unsightly One
Ph. Marek [EMAIL PROTECTED] writes:

 Please take my words as my understanding, ie. with no connection to
 mathmatics or number theory or whatever. I'll just say what I
 believe is practical.
[...]
 I'd believe that infinity can be integer, ie. has no numbers after
 the comma; and infinity is in the natural numbers (?), which are a
 subset of integers.

If that were the case, 0/Inf would == 0.

Also, if that were the case, 0..Inf would be a finite list.  (It is
trivial to prove that 0..N is a finite list with finite cardinality
for all natural numbers N.  So if you set N equal to Inf, 0..Inf would
have finite cardinality, if Inf is a natural number.)

This is obviously some new definition of Inf of which I was not
previously aware.

-- 
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b-()}}
split//,[EMAIL PROTECTED]/ --;$\=$ ;- ();print$/



Re: push with lazy lists

2004-07-16 Thread Simon Cozens
[EMAIL PROTECTED] (David Storrs) writes:
 Does it even make sense to take the Infiniteth element of an array?

You should have used a hash in the first place.

-- 
BASH is great, it dumps core and has clear documentation.  -Ari Suntioinen