Re: [Jbeta] syntax for functions and modulo

2011-10-29 Thread Raul Miller
i am replying to this in both the programming forum (where it belongs) and the beta forum (where the original message appeared). Please respond only in the programming forum. (To make this easier, I am Bcc-ing the beta forum, but I do not know how forum software will change my mail headers.) On

Re: [Jbeta] syntax for functions and modulo

2011-10-29 Thread Andrew Pennebaker
Pennebaker Sent: Friday, October 28, 2011 12:54 To: J Subject: [Jbeta] syntax for functions and modulo I'm trying to make a function mod3 that returns the input modulo three, but my syntax is wrong. I don't see why the syntax would be any different from the double example in the docs

Re: [Jbeta] syntax for functions and modulo

2011-10-29 Thread Björn Helgason
...@jsoftware.com] On Behalf Of Andrew Pennebaker Sent: Friday, October 28, 2011 12:54 To: J Subject: [Jbeta] syntax for functions and modulo I'm trying to make a function mod3 that returns the input modulo three, but my syntax is wrong. I don't see why the syntax would

Re: [Jbeta] syntax for functions and modulo

2011-10-29 Thread Raul Miller
On Sat, Oct 29, 2011 at 4:25 PM, Andrew Pennebaker andrew.penneba...@gmail.com wrote: Apologies for crossposting, I'm registering for the programming forum right now. Okay, the left argument is assigned to x, the right argument is assigned to y. What about functions with arity greater than

[Jbeta] syntax for functions and modulo

2011-10-28 Thread Andrew Pennebaker
I'm trying to make a function mod3 that returns the input modulo three, but my syntax is wrong. I don't see why the syntax would be any different from the double example in the docs. $ jconsole double =: * 2 double 1 2 double 2 4 double 3 6 mod3 =: 3 | |syntax error | mod3=:

Re: [Jbeta] syntax for functions and modulo

2011-10-28 Thread Björn Helgason
mod3=: 3 | ] mod3 11 5 3 2 2 2 0 2 2011/10/28 Andrew Pennebaker andrew.penneba...@gmail.com I'm trying to make a function mod3 that returns the input modulo three, but my syntax is wrong. I don't see why the syntax would be any different from the double example in the docs. $

Re: [Jbeta] syntax for functions and modulo

2011-10-28 Thread Roger Hui
mod3=: 3| On Fri, Oct 28, 2011 at 10:54 AM, Andrew Pennebaker andrew.penneba...@gmail.com wrote: I'm trying to make a function mod3 that returns the input modulo three, but my syntax is wrong. I don't see why the syntax would be any different from the double example in the docs. $ jconsole

Re: [Jbeta] syntax for functions and modulo

2011-10-28 Thread Lettow, Kenneth
, October 28, 2011 1:54 PM To: J Subject: [Jbeta] syntax for functions and modulo I'm trying to make a function mod3 that returns the input modulo three, but my syntax is wrong. I don't see why the syntax would be any different from the double example in the docs. $ jconsole double =: * 2 double 1

Re: [Jbeta] syntax for functions and modulo

2011-10-28 Thread Andrew Pennebaker
[mailto:beta-boun...@jsoftware.com] On Behalf Of Andrew Pennebaker Sent: Friday, October 28, 2011 1:54 PM To: J Subject: [Jbeta] syntax for functions and modulo I'm trying to make a function mod3 that returns the input modulo three, but my syntax is wrong. I don't see why the syntax would

Re: [Jbeta] syntax for functions and modulo

2011-10-28 Thread Roger Hui
1:54 PM To: J Subject: [Jbeta] syntax for functions and modulo I'm trying to make a function mod3 that returns the input modulo three, but my syntax is wrong. I don't see why the syntax would be any different from the double example in the docs. $ jconsole   double =: * 2   double 1 2

Re: [Jbeta] syntax for functions and modulo

2011-10-28 Thread Raul Miller
On Fri, Oct 28, 2011 at 3:50 PM, Andrew Pennebaker andrew.penneba...@gmail.com wrote: Thanks Björn, Roger, and Lettow. The docs imply that J and its predecessor APL use prefix/right-to-left syntax. So I expected all J code to have the form: operator operands Which docs? Anyways, my initial

Re: [Jbeta] syntax for functions and modulo

2011-10-28 Thread Tom Arneson
Try mod3=: 3| -Original Message- From: beta-boun...@jsoftware.com [mailto:beta-boun...@jsoftware.com] On Behalf Of Andrew Pennebaker Sent: Friday, October 28, 2011 12:54 To: J Subject: [Jbeta] syntax for functions and modulo I'm trying to make a function mod3 that returns the input

Re: [Jbeta] syntax for functions and modulo

2011-10-28 Thread Andrew Pennebaker
] On Behalf Of Andrew Pennebaker Sent: Friday, October 28, 2011 12:54 To: J Subject: [Jbeta] syntax for functions and modulo I'm trying to make a function mod3 that returns the input modulo three, but my syntax is wrong. I don't see why the syntax would be any different from the double

Re: [Jbeta] syntax for functions and modulo

2011-10-28 Thread Ric Sherlock
Arneson t...@tomarneson.com wrote: Try mod3=: 3| -Original Message- From: beta-boun...@jsoftware.com [mailto:beta-boun...@jsoftware.com] On Behalf Of Andrew Pennebaker Sent: Friday, October 28, 2011 12:54 To: J Subject: [Jbeta] syntax for functions and modulo I'm trying to make

Re: [Jbeta] syntax for functions and modulo

2011-10-28 Thread Ric Sherlock
: beta-boun...@jsoftware.com [mailto:beta-boun...@jsoftware.com] On Behalf Of Andrew Pennebaker Sent: Friday, October 28, 2011 12:54 To: J Subject: [Jbeta] syntax for functions and modulo I'm trying to make a function mod3 that returns the input modulo three, but my syntax is wrong. I don't see