Re: Query re: duction and precedence.

2008-03-31 Thread TSa
HaloO, Darren Duncan wrote: For other operators, non-assoc etc, the work will probably all have to be linear. Eg difference|quotient|exponentiation. That's why I would rename the left and right operator associativity to left and right sequentiality. Note that there's a fundamental difference

RE: Query re: duction and precedence.

2008-03-31 Thread Miller, Hugh (hdmi)
) =defn 1= 2 3 ^ 4 ^ , i.e., (2^3)^4 [^] (2 3 4) = defn 2= 2 3 4 ^^ , i.e., (2^(3^4)) Etc. - Hugh Miller e-mail: [EMAIL PROTECTED] -Original Message- From: Darren Duncan [mailto:[EMAIL PROTECTED] Sent: Sunday, March 30, 2008 2:00 AM To: p6l Subject: Re: Query re: duction

Re: Query re: duction and precedence.

2008-03-31 Thread Mark J. Reed
:[EMAIL PROTECTED] Sent: Sunday, March 30, 2008 2:00 AM To: p6l Subject: Re: Query re: duction and precedence. Mark J. Reed wrote: You anticipated me. So, is there a core method for foldl/foldr/inject/reduce, or do you have to roll your own as in p5? On 3/29/08, Larry Wall [EMAIL PROTECTED

Re: Query re: duction and precedence.

2008-03-30 Thread Darren Duncan
Mark J. Reed wrote: You anticipated me. So, is there a core method for foldl/foldr/inject/reduce, or do you have to roll your own as in p5? On 3/29/08, Larry Wall [EMAIL PROTECTED] wrote: On Sat, Mar 29, 2008 at 10:18:53PM -0400, Mark J. Reed wrote: : In general, is : : [op] (p1,p2,p3,p4...) :

Re: Query re: duction and precedence.

2008-03-30 Thread Mark J. Reed
I'm a believer in generalizing where possible, modulo the principles of KISS and YAGNI. The latter essentially means at least make it general enough that you can extend it later without major retooling if it turns out YNIAA.. It's pretty surprising what can turn out to be useful, so I've never

Re: Query re: duction and precedence.

2008-03-30 Thread Mark A. Biggar
Mark J. Reed wrote: I'm a believer in generalizing where possible, modulo the principles of KISS and YAGNI. The latter essentially means at least make it general enough that you can extend it later without major retooling if it turns out YNIAA.. It's pretty surprising what can turn out to be

Re: Query re: duction and precedence.

2008-03-30 Thread Patrick R. Michaud
On Sun, Mar 30, 2008 at 08:21:39AM -0700, Mark A. Biggar wrote: The reduce meta-operator over - in APL gives alternating sum, similarly alternating quotient for /, which only works if you right associate things. [-] 1,2,3,4,5,6 = 1-2+3-4+5-6 # pseudo-apl [/] 1,2,3,4,5,6 =

Re: Query re: duction and precedence.

2008-03-30 Thread Luke Palmer
On Sun, Mar 30, 2008 at 12:56 PM, Mark J. Reed [EMAIL PROTECTED] wrote: I'm a believer in generalizing where possible, modulo the principles of KISS and YAGNI. The latter essentially means at least make it general enough that you can extend it later without major retooling if it turns out

Query re: duction and precedence.

2008-03-29 Thread Mark J. Reed
In general, is [op] (p1,p2,p3,p4...) expected to return the same result as p1 op p2 op p3 op p4... including precedence considerations? That is, should [**](2,3,4) return 2^(3^4)=2^81, or (2^3)^4 = 4096? -- Mark J. Reed [EMAIL PROTECTED]

Re: Query re: duction and precedence.

2008-03-29 Thread Larry Wall
On Sat, Mar 29, 2008 at 10:18:53PM -0400, Mark J. Reed wrote: : In general, is : : [op] (p1,p2,p3,p4...) : : expected to return the same result as : : p1 op p2 op p3 op p4... : : including precedence considerations? : : That is, should : : [**](2,3,4) : : return 2^(3^4)=2^81, or (2^3)^4 =

Re: Query re: duction and precedence.

2008-03-29 Thread Mark J. Reed
You anticipated me. So, is there a core method for foldl/foldr/inject/reduce, or do you have to roll your own as in p5? On 3/29/08, Larry Wall [EMAIL PROTECTED] wrote: On Sat, Mar 29, 2008 at 10:18:53PM -0400, Mark J. Reed wrote: : In general, is : : [op] (p1,p2,p3,p4...) : : expected to