--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/6bdfed6a-13c7-4e86-8dcf-5d61b18e15d7%40googlegroups.com.
Hi Adrian,The article seems to be missing a type definition for Ann.Perhaps some of this you already know...(match expr ...)is a pattern matcher, working to find a pattern that 'expr' fits.[(Lam _ _) ...]is attempting to match a pattern where a 'expr' is a struct called Lam, and that structure has two fields. In this case, the value of those fields is ignored, so the variable '_' is used to (by convention, not by syntax) tell the programmer that these values do not matter. (At least, I'm reasonably confident this is by convention and not by syntax.)The form[(Ann e t) ...] is matching the structure 'Ann', and binding the value in the first field to the identifier 'e', and the second value to 't'. Then, the expression following is executed (assuming the pattern matched).In the article, there is no struct definition for 'Ann'. I suspect it is a typo/oversight. This would work:(struct Ann (e t))would be a reasonable definition. It says "Ann" is a data structure with two fields, called "e" and "t".I haven't read the article, so "better" names for those fields is not something I am going to come up with right now. The name in the definition matters (to you, the programmer), but the identifier used to bind in the pattern is not critical. (Or, it is again something that should be important to you, but it does not need to match the names of the fields in the struct definition.)Hopefully that helps, and helps you move forward a bit. Ask more questions if that didn't help. And, perhaps putting your code as-is in a Github Gist or similar, so that others can look at exactly what you're working with would be useful.(I have no idea how complete or incomplete the code in the article is, which is why I suggest you put it in a pastebin/gist to share... there might be other things that were glossed in the article? I don't know.)Cheers,Matt
To unsubscribe from this group and stop receiving emails from it, send an email to racket...@googlegroups.com.
You need to add a case in parse-expr
to deal with annotations, which is in the form (<expr> : <type>)
.
E.g.,
[`(,e : ,t) (TA (parse-expr e) (parse-type t))]
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/1cde88c7-0eb8-4cf6-9a80-3708b7e35a6b%40googlegroups.com.
You need to add a case in
parse-expr
to deal with annotations, which is in the form(<expr> : <type>)
.E.g.,
[`(,e : ,t) (TA (parse-expr e) (parse-type t))]
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/1cde88c7-0eb8-4cf6-9a80-3708b7e35a6b%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/1cde88c7-0eb8-4cf6-9a80-3708b7e35a6b%40googlegroups.com.
Hi Adrian,
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/1cde88c7-0eb8-4cf6-9a80-3708b7e35a6b%40googlegroups.com.
I'm a mathematician delving into type theory and proof assistants and with special interests in Racket.I'm now trying to understand and implement P. Ragde's Proust "nano proof assistant" and work through the examples in his article. However, I'm pretty much a beginner in Racket and I'm getting some errors.