On Wed, 10 Oct 2001 15:42:29 +1000 (EST), Damian Conway wrote:
Brent asked:
If we have 'and', 'or' and 'xor', can we have 'dor' (defined or) to be a
low-precedence version of this?
I actually suggested exactly that to Larry a few weeks back.
He likes the idea, but is having trouble
I just read Apocalypse and Exegesis 3, and something stuck out at me
because of its omission, namely using hyper operators for reduction.
$a ^+= @list; # should sum the elements of @list
Larry says @a ^+ 1 will replicate the scalar value for all a's, and Damian
talks about doing summation with
Alberto Simoes wrote:
:2) using ^ for mapping operators.. this only works with two lists.
:The problem here is that we have a pair of lists, and want a
:list of pairs. There can be other situations where we have
:three lists, instead of a list of tripplets... I thought it was
:better to have a
On Sun, 7 Oct 2001 12:27:17 +1000 (EST), Damian Conway wrote:
The step you're missing is that the non-numeric string hello,
when evaluated in a numeric context, produces NaN. So:
hello == 0 0 != NaN
is:
Nan == 0 0 != NaN
which is false.
So to what does 123foo evaluate in
On Sat, 06 Oct 2001 22:20:49 -0400, John Siracusa wrote:
So, in the
operator, the filter is the adverb:
$sum =
@costs : {$^_ 1000};
WTF is that operator? All I see is a black block. We're not in ASCII any
more, Toto...
--
Bart.
Bart Lateur [EMAIL PROTECTED] writes:
On Sat, 06 Oct 2001 22:20:49 -0400, John Siracusa wrote:
So, in the
operator, the filter is the adverb:
$sum =
@costs : {$^_ 1000};
WTF is that operator? All I see is a black block. We're not in ASCII any
more, Toto...
I'm guessing
John observed:
I just read Apocalypse and Exegesis 3, and something stuck out at me
because of its omission, namely using hyper operators for reduction.
$a ^+= @list; # should sum the elements of @list
Larry says @a ^+ 1 will replicate the scalar value for all a's,
hi,
Any idea what the continuation will be ? Something similar like
while(){..}continue{..} construct, but more primitive/lower-level ?
{ my $val = 10 } -= { print $val; $val = 11 } -= { print $val }
prints 10 and 11 i.e. lexicals of BLOCK1 are preserved for BLOCK2 and BLOCK3
i.e until
On 10/10/01 7:27 AM, Piers Cawley wrote:
Bart Lateur [EMAIL PROTECTED] writes:
On Sat, 06 Oct 2001 22:20:49 -0400, John Siracusa wrote:
So, in the
operator, the filter is the adverb:
$sum =
@costs : {$^_ 1000};
WTF is that operator? All I see is a black block. We're not in
Damian Conway wrote:
But I assume that == means numerically equal (and here I could be
wrong). If what I assume is true however, then anything which doesn't
have any numerical meaning, numerically compared to anything (even to
itself) should not return the misleading result
Dan Sugalski wrote:
At 08:37 AM 10/9/2001 -0700, Brent Dax wrote:
For consistency, I'd prefer to use is: 3+(2 is i).
Well, the convention is suffixing an imaginary number with an i. I don't
think we'd be too well served to go a different route.
So the imaginary numbers would be standard
At 05:12 PM 10/10/2001 +0200, RaFaL Pocztarski wrote:
Dan Sugalski wrote:
At 08:37 AM 10/9/2001 -0700, Brent Dax wrote:
For consistency, I'd prefer to use is: 3+(2 is i).
Well, the convention is suffixing an imaginary number with an i. I don't
think we'd be too well served to go a
If we are in the mood of changing operators, can be /\
and || can be \/. At least, mathematicians will like it!
Cheers
Albie
--
| Alberto Manuel Brandão Simões |
| [EMAIL PROTECTED] |
| http://numexp.sourceforge.net |
On Wed, 10 Oct 2001 11:32:02 -0400
Dan Sugalski [EMAIL PROTECTED] wrote:
Great idea, as well as sqrt(-1) returning 1i istead of raising the
exception.
If we do them, yep. Currently no promises there.
If you do that, make sure it has to be enabled with a pragma. Having
complex numbers
At 04:42 PM 10/10/2001 +0100, Sam Vilain wrote:
On Wed, 10 Oct 2001 11:32:02 -0400
Dan Sugalski [EMAIL PROTECTED] wrote:
Great idea, as well as sqrt(-1) returning 1i istead of raising the
exception.
If we do them, yep. Currently no promises there.
If you do that, make sure it has to be
On Wed, Oct 10, 2001 at 05:20:06PM +0100, Piers Cawley wrote:
( Alberto Manuel Brandao Simoes [EMAIL PROTECTED] writes:
(
( If we are in the mood of changing operators, can be /\
( and || can be \/. At least, mathematicians will like it!
(
( You are, of course, joking.
No...
BTW, I was thinking once that numeral literals like 4k or 10G
(meaning 4*2**10, 10*2**30) would be very nice. What do you think?
I think the meaning of the suffices are sufficiently vague as to make me
uncomfortable supporting them. Is 1K 1024 or 1000? I can make a good case
for both, and
On Wed, Oct 10, 2001 at 05:21:02PM +0200, raptor wrote:
| So the imaginary numbers would be standard literals? Like
|
| $x=2+10i;
|
| Great idea, as well as sqrt(-1) returning 1i istead of raising the
| exception. BTW, I was thinking once that numeral literals like 4k or 10G
| (meaning
On Wed, Oct 10, 2001 at 06:20:31PM +0200, Trond Michelsen wrote:
BTW, I was thinking once that numeral literals like 4k or 10G
(meaning 4*2**10, 10*2**30) would be very nice. What do you think?
I think the meaning of the suffices are sufficiently vague as to make me
uncomfortable
Trond Michelsen wrote:
BTW, I was thinking once that numeral literals like 4k or 10G
(meaning 4*2**10, 10*2**30) would be very nice. What do you think?
I think the meaning of the suffices are sufficiently vague as to make me
uncomfortable supporting them. Is 1K 1024 or 1000? I can make a
Dan Sugalski wrote:
I'll leave that for Larry to decide. I'm just thinking of all the 60G hard
drives I see at Best Buy that are really 60e9 bytes, and the 1K ohm
resistors that are really 1000 ohms. (Well, give or take a bit for ambient
temperature...)
I prefer powers of 1024 because it
Dan Sugalski wrote:
At 04:42 PM 10/10/2001 +0100, Sam Vilain wrote:
On Wed, 10 Oct 2001 11:32:02 -0400
Dan Sugalski [EMAIL PROTECTED] wrote:
Great idea, as well as sqrt(-1) returning 1i istead of raising the
exception.
If we do them, yep. Currently no promises there.
If you do
Trond Michelsen wrote:
There's always the possibility of supporting SI's binary prefixes ;)
http://physics.nist.gov/cuu/Units/binary.html
An excellant idea. I was unaware of that standard, but was trying to head that
direction in my last posting.
Someone thought it wouldn't work with
On Wed, 10 Oct 2001 11:52:16 -0400, Dan Sugalski wrote:
If people want base 10, let them use e syntax.
1e3 = 1000
1k = 1024
I'll leave that for Larry to decide. I'm just thinking of all the 60G hard
drives I see at Best Buy that are really 60e9 bytes, and the 1K ohm
resistors that are really
On Wed, Oct 10, 2001 at 06:38:05PM +0200, RaFaL Pocztarski wrote:
I prefer powers of 1024 because it help a lot more than powers of 1000.
But if you think that the ambiguity is the only problem then use kbin; /
use kdec; or use k1000; / use k1024; pragmas could solve it.
$K = 2**10;
On Wed, 2001-10-10 at 17:32, Dan Sugalski wrote:
At 05:12 PM 10/10/2001 +0200, RaFaL Pocztarski wrote:
BTW, I was thinking once that numeral literals like 4k or 10G
(meaning 4*2**10, 10*2**30) would be very nice. What do you think?
I think the meaning of the suffices are sufficiently
At 07:01 PM 10/10/2001 +0200, Bart Lateur wrote:
On Wed, 10 Oct 2001 11:52:16 -0400, Dan Sugalski wrote:
If people want base 10, let them use e syntax.
1e3 = 1000
1k = 1024
I'll leave that for Larry to decide. I'm just thinking of all the 60G hard
drives I see at Best Buy that are
So the imaginary numbers would be standard literals? Like
$x=2+10i;
Great idea, as well as sqrt(-1) returning 1i istead of raising the
exception. BTW, I was thinking once that numeral literals
like 4k or 10G
(meaning 4*2**10, 10*2**30) would be very nice. What do you think?
-
:Alberto Manuel Brandao Simoes [EMAIL PROTECTED] writes:
:
:If we are in the mood of changing operators, can be /\
: and || can be \/. At least, mathematicians will like it!
:
:You are, of course, joking.
:
:--
:Piers
Given Damian's sigma operator in E3, there is no
U mean something like 'term' (or how this thing is called 'bareword' ? )
So I can say :
# $x = 10k;
my sub operator:number is postfix(k) ($num) {
return $num * 1000
}
# $x = 10K;
my sub operator:number is postfix(K) ($num) {
return $num * 1024
}
#u can say later print $x if $x?;
On Wed, Oct 10, 2001 at 06:28:42PM +0200, raptorVD wrote:
U mean something like 'term' (or how this thing is called 'bareword' ? )
So I can say :
# $x = 10k;
my sub operator:number is postfix(k) ($num) {
return $num * 1000
}
I think that would be
sub operator:K is postfix
On Wed, Oct 10, 2001 at 10:21:38AM -0700, David Whipp wrote:
First this thread tells me that 123foo will be 123 in numeric
context. Now I find myself wondering what 123indigo evaluates
to!
It would evaluate to 123. If use complex is in effect, it would
evaluate to 123i. At least that's the
Glenn Linderman wrote:
An excellant idea. I was unaware of that standard, but was trying to head that
direction in my last posting.
Someone thought it wouldn't work with imaginary numbers, but there actually is
no ambiguity if the imaginary i must immediately follow the number, and the
Buddha Buck wrote:
As someone else pointed out, the e notation is good for powers of
10. How about a corresponding b notation for binary
exponents? 4_294_967_296 == 4b30?
I really like that idea, it makes the floating point (scientific?)
notation symmetric and consistent with X/Xi SI
Jonathan Scott Duff wrote:
On Wed, Oct 10, 2001 at 10:21:38AM -0700, David Whipp wrote:
First this thread tells me that 123foo will be 123 in numeric
context. Now I find myself wondering what 123indigo evaluates
to!
It would evaluate to 123. If use complex is in effect, it would
First this thread tells me that 123foo will be 123 in numeric
context. Now I find myself wondering what 123indigo evaluates
to!
It would evaluate to 123. If use complex is in effect, it would
evaluate to 123i. At least that's the position I'm taking at the
moment ;-)
123i
On Wed, Oct 10, 2001 at 09:42:58PM +1000, Damian Conway wrote:
John observed:
I just read Apocalypse and Exegesis 3, and something stuck out at me
because of its omission, namely using hyper operators for reduction.
$a ^+= @list; # should sum the elements of @list
HellyerP [EMAIL PROTECTED] writes:
:Alberto Manuel Brandao Simoes [EMAIL PROTECTED] writes:
:
: If we are in the mood of changing operators, can be /\
: and || can be \/. At least, mathematicians will like it!
:
:You are, of course, joking.
Given Damian's sigma operator
On Wed, Oct 10, 2001 at 01:27:35PM -0700, Colin Meyer wrote:
On Wed, Oct 10, 2001 at 09:42:58PM +1000, Damian Conway wrote:
John observed:
I just read Apocalypse and Exegesis 3, and something stuck out at me
because of its omission, namely using hyper operators for
On Wed, Oct 10, 2001 at 01:27:35PM -0700, Colin Meyer wrote:
On Wed, Oct 10, 2001 at 09:42:58PM +1000, Damian Conway wrote:
John observed:
I just read Apocalypse and Exegesis 3, and something stuck out at me
because of its omission, namely using hyper operators for
On Wed, Oct 10, 2001 at 02:23:33PM -0700, Colin Meyer wrote:
[ @a ^+= @b ]
What I'd expect is more like:
foreach my $elem (@a) {
$elem ^+= @b;
}
Hrm. Why would you expect that when you'd have written as you just
did? Would you also expect
@a = @b ^+ @c;
to mean
On Wed, 10 Oct 2001 14:23:33 -0700, Colin Meyer wrote:
Does this mean that
@a ^+= @b;
will add every value of @b to every value of @a?
What I'd expect is more like:
foreach my $elem (@a) {
$elem ^+= @b;
}
If you want that effect, apply scalar on the RHS.
--
On Wed, Oct 10, 2001 at 04:34:14PM -0500, Jonathan Scott Duff wrote:
On Wed, Oct 10, 2001 at 02:23:33PM -0700, Colin Meyer wrote:
[ @a ^+= @b ]
What I'd expect is more like:
foreach my $elem (@a) {
$elem ^+= @b;
}
Hrm. Why would you expect that when you'd have written as
On Wed, Oct 10, 2001 at 03:41:18PM -0700, Colin Meyer wrote:
Maybe this illustrates my confusion:
$a = 1;
@a = (1);
@b = (1, 2, 3);
@c = (4, 5, 6);
$a = $a ^+ @b;
@a = @a ^+ @b;
print $a; # 7
print @a; # 7 or 2?
Or, after re-reading the apocolypse again, it seems:
print @a;
Aaron asked:
I'm wondering about some other operators Will there be a ^?? operator?
I believe that there will be a hyperoperator for *every* operator.
I might, for example, say:
@a = @b ^?? 'yea' :: 'nay';
Which I would expect to be the same as:
Colin exemplifies:
$a = 1;
@a = (1);
@b = (1, 2, 3);
@c = (4, 5, 6);
$a = $a ^+ @b;
@a = @a ^+ @b;
print $a; # 7
No. It will (probably) print: 4. Because:
$a = $a ^+ @b;
becomes:
$a = ($a,$a,$a) ^+ @b;
which is:
$a =
$a ^+= @list; # should sum the elements of @list
Does this mean that
@a ^+= @b;
will add every value of @b to every value of @a?
No. The rule is that a hyperoperator replicates its lower-dimensional
operand up to the same number of dimensions as its
According to Damian:
Colin exemplifies:
$a = 1;
@a = (1);
@b = (1, 2, 3);
@c = (4, 5, 6);
$a = $a ^+ @b;
@a = @a ^+ @b;
print $a; # 7
No. It will (probably) print: 4. Because:
print @a; # 7 or 2?
Prints: 2 2 3. Because:
So, does that mean:
$a = ($a) ^+ @b;
print $a; # prints: 3
# $a = ($a,undef,undef) ^+ @b ...
Yes.
My new confusion has to do with why does the hyperoperator expand $a to
($a,$a,$a), but (1) to (1,undef,undef)? Oh, it's because hyper-ops
expand an arg if it is
Damian Conway wrote:
@a ^+= reduce {$^a+$^b} @b;
What's this? Are positional args to HOFs now alphabetic rather than numeric?
cf. http://dev.perl.org/rfc/23.html#Positional_placeholders
@a ^+= reduce {$^a+$^b} @b;
What's this? Are positional args to HOFs now alphabetic rather than
numeric?
No. I just chose to used named placeholders, since they're more easily
followed in this example.
cf. http://dev.perl.org/rfc/23.html#Positional_placeholders
cf.
Okay, I've finished version 0.02 of babyperl. In addition to constants,
variables, operators, and functions, it now understands comments (in a
rudimentary way--watch out if a constant string contains #), if,
if/else, unless, unless/else, while, and do/while. I relented and put
in _ for concat.
52 matches
Mail list logo