Funny precedence rule

0 views
Skip to first unread message

Kevin Lyles

unread,
Sep 12, 2006, 6:22:40 PM9/12/06
to iit-cs440-2006-08
Hey everyone,

I ran into this on problem 24. Apparently a function call binds
tighter than adding an element to a list. So,

fun x::xs

means

(fun x)::xs

not

fun (x::xs)

as you (or at least I) would think.

A. Mattox Beckman, Jr.

unread,
Sep 12, 2006, 9:46:14 PM9/12/06
to iit-cs44...@googlegroups.com
Think of it like

f 3 + 5

You would (well, I would) expect f 3 to be done first....

If you buy that, then the rules are consistent. :-)

- Mattox


--
A. Mattox Beckman, Jr., Ph.D. <beckm...@gmail.com>
Computer Science, Illinois Institute of Technology
- Where there is life, there is hope. - J. R. R. Tolkien (and others....)

Reply all
Reply to author
Forward
0 new messages