True/False

2 views
Skip to first unread message

Joe Gibbs Politz

unread,
Mar 27, 2013, 9:47:18 PM3/27/13
to lamb...@googlegroups.com
Fun fact:

If you change every instance of CTrue and CFalse in desugaring into (CId 'True (GlobalId)) and (CId 'False (GlobalId)), respectively, we pass all the same tests.  We only need the top let-binding.

I think we had a thread about this a while back when we were doing store rewrites, but it's a useful result to have.  It just reminds me that if we made CObject a little more flexible, we could rid ourselves of CTrue, CFalse, and CNone.

Joe Gibbs Politz

unread,
Mar 27, 2013, 9:49:35 PM3/27/13
to lamb...@googlegroups.com
BTW, all of these observations are coming up as I write up the details of our model in the appendix; I'm trying to explain what's absolutely essential and what is sort of an artifact of the interpreter still, if only for our own posterity moving forward.

Alejandro Martinez

unread,
Mar 28, 2013, 1:33:30 AM3/28/13
to lamb...@googlegroups.com

This reminds me we don't enforce the singleton pattern for NoneType: type(None)() builds a new bogus instance of NoneType which 'is not' None.
Although it seems an easy fix

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

Joe Gibbs Politz

unread,
Mar 28, 2013, 1:36:27 AM3/28/13
to lamb...@googlegroups.com
Yeah that should be an easy couple of special cases in type().

Alejandro Martinez

unread,
Mar 28, 2013, 1:41:07 AM3/28/13
to lamb...@googlegroups.com

Or simply NoneType.new to raise an exception since the good one is bult by other means

Reply all
Reply to author
Forward
0 new messages