This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GSOC | Extending Common Lisp support


On May 28, 2012, at 4:29 PM, Charles Turner wrote:

Does the following behaviour look reasonable?

(from Common Lisp & Scheme)
#|kawa:1|# |clisp:boolean|
Type boolean
#|kawa:2|# boolean
Type boolean
#|kawa:3|# |clisp:t|
ClassType java.lang.Object
#|kawa:4|# |clisp:nil|
Type void
#|kawa:5|# t
t
#|kawa:6|# nil
()

Looks good to me.


I'm achieving that by the following in Common Lisp's type map (a new
addition to CommonLisp)

     booleanType = new LangPrimType(Type.booleanType,
CommonLisp.getInstance());
     types.put("boolean", booleanType);
     types.put("t", ClassType.make("java.lang.Object")); // perhaps
Type.objectType instead (akin to Scheme's object type)?
     types.put("nil", Type.voidType);

Yeah, let's use Type.objectType since it's already a thing.


We probably need a type category for either sets of values or
predicates, but let's defer that until we deal with patterns.

OK, I mainly wanted |clisp:boolean| to start working so that I could include the return types in my primitives.lisp file. That's done now, but the refactoring is far from satisfying. I don't want to get overly sidetracked here, but it's sometimes hard to refrain when the problem is so open ended! :-)

The mindset of a true engineer. :-)


Thanks again,
--
Charles Turner

-- Jamison Hope The PTR Group www.theptrgroup.com




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]