quote in pydesugar

48 views
Skip to first unread message

Sarah Hong

unread,
Apr 5, 2013, 3:58:25 PM4/5/13
to utah-compiler...@googlegroups.com
Hi,

I'm having trouble understanding when we would encounter quote in in pydesugar.rkt since the HIR doesn't have anything that returns quote?  I also would like some hints on what exactly we need to do to process quote.  In lecture Matt said he uses a function called desugar-quote, but the only one we fill in is desugar-exp. Should we make a helper function which handles quotes?

Thanks,

Sarah

Matt Might

unread,
Apr 5, 2013, 5:21:13 PM4/5/13
to Sarah Hong, utah-compiler...@googlegroups.com
I don't think you'll encounter quoted forms.

Don't implement it if you don't need it.

-Matt

Michael Brown

unread,
Apr 12, 2013, 2:59:27 PM4/12/13
to utah-compiler...@googlegroups.com
I've ran into quotes twice, even though they seem to be bugs in the HIR reference implementations. If you run:

make pytrans
x = None

You get back:

(program (define x (void)) (set-global! x 'None))

Notice how the None has a quote at the beginning.  This also happens when Ellipsis is used in the python code.
Any word from Matt or the TA's if we have to worry about this?

Petey A

unread,
Apr 12, 2013, 3:05:50 PM4/12/13
to Michael Brown, utah-compilers-spring-2013
I don't have access to Matt's code, so there's precious little I can do to debug this (if it is, in fact, a bug in Matt's code).

As this seems like the most probable explanation, my recommendation is that you document what you found in your README. Even though this is a short program, it's unlikely to be one of the test cases that Matt chooses to use.

I think that expecting None instead of 'None is reasonable, but my opinion doesn't actually count for that much :) I think you'll be fine, though, especially if you document what you found.


- Petey


--
You received this message because you are subscribed to the Google Groups "Utah Compilers, Spring 2013" group.
To unsubscribe from this group and stop receiving emails from it, send an email to utah-compilers-spri...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Petey A

unread,
Apr 12, 2013, 3:06:21 PM4/12/13
to Michael Brown, utah-compilers-spring-2013
PS my reading of HIR is like yours: I think that it _ought_ to be None and not 'None.


- Petey

Petey A

unread,
Apr 12, 2013, 3:12:07 PM4/12/13
to Michael Brown, utah-compilers-spring-2013
Incidentally, Matt said that you shouldn't expect to see quoted forms. So having a match clause that does something like:

(match ''None
  [''None 'None])

is a reasonable workaround. At least, it is since the assignment is due today.


- Petey

Matt Might

unread,
Apr 15, 2013, 12:56:44 AM4/15/13
to Petey A, Michael Brown, utah-compilers-spring-2013
I've confirmed: it should be None.

The 'None is outside the grammar, so it's a bug in my pytrans.

I'll accept any interpretation of this, however.

That is, if you handle None but not 'None, or 'None but not None, or
both, that's fine with me.

This is retroactive to project 3.

-Matt
Reply all
Reply to author
Forward
0 new messages