From: Chad Perrin Date: 2009-02-23T21:38:26+09:00 Subject: Re: Nexus Programming Language --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 23, 2009 at 01:09:34AM +0900, Ken Bloom wrote: >=20 > "There are no precedence rules applied to operators, they are simply=20 > evaluated from left to right. Operator precedence is explicity applied=20 > with the use of parenthetical expressions. The following example=20 > demonstrates explicit operator precedence." >=20 > Looks like a cross between Ruby and INTERCAL. When 1.0+2.0/3.0+4.0=3D5.0,= =20 > that's not a good thing, and will confuse most mathemeticians to no end.= =20 > And the use of ^ for assignment will also be very unintuitive. This is why I tend to think that positional precedence should always use named functions (or methods or whatever) instead of traditional mathematical sigils, and use either prefix or postfix notation. For instance: sum( quotient( sum( 1.0, 2.0 ), 3.0 ), 4.0 ) =2E . . or as UCBLogo would put it: sum quotient sum 1.0 2.0 3.0 4.0 =2E . . or: sum (quotient (sum 1.0 2.0) 3.0) 4.0 =2E . . if you really want parentheses or need different numbers of operands for each operator/function than the default two arguments. In the same language, you can still do: (1.0 + 2.0) / 3.0 + 4.0 =2E . . to get 5.0, if you really want to do it the traditional precedence way. I wish more languages offered named prefix operators like that. Ruby's .method syntax is pretty nice, too, though: 1.0.+(2.0)./(3.0).+4.0 =2E . . as long as you aren't working with floating point numbers, since all those extra dots/decimals look *awful* strung together like that. --=20 Chad Perrin [ content licensed OWL: http://owl.apotheon.org ] Quoth Martin Fowler: "Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --W/nzBZO5zC0uMSeA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAkmimFoACgkQ9mn/Pj01uKUKLwCdH+SVM6bQITa0OUJVGaHsMbZG cPsAoNhN/mV4D1lQSq7X5Kjkz/AcKm1q =Y7mU -----END PGP SIGNATURE----- --W/nzBZO5zC0uMSeA--