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 28 May 2012 21:04, Per Bothner <per@bothner.com> wrote:
> I think you're confusing the *value* t vs the *type specifier* t.
> They have nothing to do with each other, and |clisp:t| evaluates
> to the latter - which should be equivalent to java.lang.Object.

Not just confused, I wasn't aware of that! 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
()

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);

> 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! :-)

Thanks again,
--
Charles Turner


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