LWN.net Logo

It's a mistake to ignore the customer

It's a mistake to ignore the customer

Posted Dec 7, 2012 7:23 UTC (Fri) by mathstuf (subscriber, #69389)
In reply to: It's a mistake to ignore the customer by vonbrand
Parent article: GNU Guile 2.0.7 released

I like Haskell's solution: custom defined operators with 10 available precedence levels (I forget exactly, but I remember 10) with the "standard" ones spaced out along it.


(Log in to post comments)

It's a mistake to ignore the customer

Posted Dec 7, 2012 9:39 UTC (Fri) by ekj (guest, #1524) [Link]

Isn't that terribly hard to read ?

How do you know what will happen with:

a + b [custom] c * d

Means:

(a+b) [custom] (c * d)

Or:

((a+b) [custom] c) * d

Or:

a + (b [custom] c) * d

It's a mistake to ignore the customer

Posted Dec 7, 2012 16:18 UTC (Fri) by mathstuf (subscriber, #69389) [Link]

Generally, the operators don't work just on numbers and so they don't mix much with the common ones much. Its to establish order within a class of operators (e.g., within the monad operators, arrow operators, and so on). If mathematical expressions tend to get passed in to them, make them lower precedence, otherwise you can play with the higher ones.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds