Closed Kaykwanu closed 6 years ago
Thanks for the feedback. I'll think about how to improve this section, but for now, to help you make progress:
set-size(S)
, write S.size()
and you'll get the size.error
should be raise
(thanks!)include pick
at the top of your program [https://www.pyret.org/docs/latest/pick.html]Hope this helps you make progress for now.
That was really quick. Thanks. But on correction,
include pick fun an-elt(s :: Set): cases (Pick) set-pick(s): | pick-none => raise("empty set") | pick-some(e, r) => e end end
Pyret says "set-pick" is undefined? I tried this though:
include pick fun an-elt(s :: Set): cases (Pick) s: | pick-none => raise("empty set") | pick-some(e, r) => e end end
Is that fine? Find attached.
On Tue, Oct 10, 2017 at 3:07 PM Shriram Krishnamurthi < notifications@github.com> wrote:
Thanks for the feedback. I'll think about how to improve this section, but for now, to help you make progress:
- Instead of set-size(S), write S.size() and you'll get the size.
- error should be raise (thanks!)
- Add include pick at the top of your program [ https://www.pyret.org/docs/latest/pick.html https://www.pyret.org/docs/latest/pick.html]
Hope this helps you make progress for now.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/brownplt/pyret-lang/issues/1219#issuecomment-335484213, or mute the thread https://github.com/notifications/unsubscribe-auth/AWDxe2WI75RVDuZc5TX_8dXaiD09XVszks5sq3oygaJpZM4Pz-XW .
Use s.pick()
instead of set-pick(s)
:)
Really appreciate the prompt response. Thanks alot. On Tue, Oct 10, 2017 at 4:39 PM sorawee notifications@github.com wrote:
Use s.pick() instead of set-pick(s) :)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/brownplt/pyret-lang/issues/1219#issuecomment-335515175, or mute the thread https://github.com/notifications/unsubscribe-auth/AWDxe4bFwgYSBOBT6S1fp-RRzxxps5_Aks5sq4-7gaJpZM4Pz-XW .
Closing as resolved?
I am having issues getting past this chapter. Pyret keeps saying that "The identifier set-size is unbound:"
check: song-set3 = [set: lver, so, wnkkhs, so, so, lver, so] song-set is song-set3 set-size(song-set3) is 3 end
More so, I can't seem to run this:
fun an-elt(s :: Set): cases (Pick) set-pick(s): | pick-none => error("empty set") | pick-some(e, r) => e end end
Pyret also says "Pick" is not defined as a type and that both "set-pick" and "error" are unbound.
Is this a case of the intentional mistakes included in the book, as part of teaching style? I can't seem to figure it out. Please help.