Possible errata page 129, exercise 4.29

23 views
Skip to first unread message

tlko...@verizon.net

unread,
Jul 17, 2013, 12:57:16 PM7/17/13
to eo...@googlegroups.com
I'm working my way through the book, and when entering this code from pg 129 ex 4.29
(run "
let a = newarray(2, -99)
    p = proc (x)
         let v = arrayref(x,1)
         in arrayset(x,1,-(v, -1))
in begin
     arrayset(a, 1, 0);
     (p, a);
     (p, a);
     arrayref(a,1)
  end")
I get  " parsing: at line 3: looking for "in", found identifier p in production..."  
I'm keying all my code incrementally as I work through the exercises so this could just be my bug, but when I look in the  code for mutable pairs or the site, I see nothing which would suggest let should allow multiple declarations in a let.  Is this really a typo?

Mitchell Wand

unread,
Jul 17, 2013, 4:16:37 PM7/17/13
to eopl3
Yup, if you look at the grammar for MUTABLE-PAIRS, you'll see that it only allows a single declaration in a let.

This probably wasn't intentional, but it's in an exercise.  You are being asked to modify the language, so do it.  ;)

--Mitchell





--
You received this message because you are subscribed to the Google Groups "EOPL3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eopl3+un...@googlegroups.com.
To post to this group, send email to eo...@googlegroups.com.
Visit this group at http://groups.google.com/group/eopl3.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

tlko...@verizon.net

unread,
Jul 18, 2013, 12:21:30 PM7/18/13
to eo...@googlegroups.com
Thanks .  I didn't think it was intentional but sure  why not...
Reply all
Reply to author
Forward
0 new messages