Hyper-operators and Underscore

2001-10-06 Thread Erik Lechak
Hello all, I have been using Perl for years. It is the language of choice for most of my needs. This is my first time posting. I have read Apocalypse 3 and many of your responses. Issues: 1) Binary _or string concatenation 2) RFC 082: Arrays: Apply operators element-wise in a

Re: Hyper-operators and Underscore

2001-10-06 Thread Jeremy Howard
Erik Lechak wrote: 2) RFC 082: Arrays: Apply operators element-wise in a list context (hyper operators) and 3) Special variable representing index of array in foreach structure $# maybe (not in apocolypse3, I think) Hi Eric. Thanks for your comments. Unfortunately it's a little early for

Re: Hyper-operators and Underscore

2001-10-06 Thread Erik Lechak
Thanks for the info, Bryan, Thank you for the info. I am more engineer than computer scientist, so please excuse the ignorance behind these questions. Except that the operator truly is simply an underscore. But it's also a valid identifier character, so where it may be confused

Re: Hyper-operators and Underscore

2001-10-06 Thread Bryan C . Warnock
On Saturday 06 October 2001 03:47 pm, Erik Lechak wrote: Thank you for the info. I am more engineer than computer scientist, so please excuse the ignorance behind these questions. No problem. Except that the operator truly is simply an underscore. But it's also a valid identifier

Re: Hyper-operators and Underscore

2001-10-06 Thread Erik Lechak
Bryan, I guess my biggest complaint was that underscore would be the only single character operator that would be in danger of being lumped into the variable name. I forgot about x . I use it all the time. If x has that constraint why not the underscore. I worked at a place where

Re: General Feelings on Apoc 3

2001-10-06 Thread Rafael Garcia-Suarez
David M. Lloyd wrote: On Thu, 4 Oct 2001, Michael G Schwern wrote: Backtracking is at the heart of Logic Programming (or Declarative Programming, if you like). This is one of the 3 main programming paradigms (along with procedural and functional). The most popular Declarative

TIMTOWT concat / hypo-operators

2001-10-06 Thread Edwin Steiner
Hello! Is this going to concat $a,$b and $c? $foo = _($a,$b,$c); (One way to save underlines and spaces.) Or would that be: $foo = _@($a,$b,$c); BTW: what will these do? $a _=_ ($b,$c); $a ^_= ($b,$c); # (better with hypo-operator?, see below) (WIM in

RE: TIMTOWT concat / hypo-operators

2001-10-06 Thread Brent Dax
Edwin Steiner: # Is this going to concat $a,$b and $c? # # $foo = _($a,$b,$c); # # (One way to save underlines and spaces.) # Or would that be: # # $foo = _@($a,$b,$c); That would be C$foo=join('', $a, $b, $c), just like in Perl 5. # BTW: what will these do? # # $a _=_

Quick EX3 question

2001-10-06 Thread John Siracusa
Are these the same thing? print _@{$data.{costs}}; print _ $data{costs}; -John

Re: Customizable default hash and array values.

2001-10-06 Thread Bart Lateur
On Fri, 28 Sep 2001 21:27:48 +0200, Johan Vromans wrote: Michael G Schwern [EMAIL PROTECTED] writes: so if $key does not exist you'll get 'some default' instead of undef. Except that a more common case is my $foo = $hash{foo} || 'some default'; my $bar = $hash{bar} || 'some other

EX3: $a == $b != NaN

2001-10-06 Thread John Siracusa
Okay, so this: 100 -s $filepath = 1e6 really means this: 100 -s $filepath-s $filepath = 1e6 which means that this: $a == $b != NaN really means this: $a == $b $b != NaN But $a == $b != NaN is supposed to [solve] the problem of numerical comparisons between

EX3: Adverbs and print()

2001-10-06 Thread John Siracusa
From EX3: A subroutine's adverbs are specified as part of its normal parameter list, but separated from its regular parameters by a colon: my sub operator:… is prec(\operator:+($)) ( *@list : $filter //= undef) { ... This specifies that operator:… can take a single scalar adverb, which is

Re: EX3: $a == $b != NaN

2001-10-06 Thread John Siracusa
On 10/6/01 10:27 PM, Damian Conway wrote: Doesn't that mean: hello == 0 0 != NaN will evaluate to true? No. 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 ==

Re: Are .key and .value right for Pairs?

2001-10-06 Thread Randal L. Schwartz
Damian == Damian Conway [EMAIL PROTECTED] writes: Too much typing: Damian module PAIR; Damian method car { return .key } Damian method cdr { return .value } Damian method AUTOVIVIFY (default, $name) { Damian if ($name =~ m/^c([ad])([ad]*)r$/) {