discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OpenMCL


From: Pascal J . Bourguignon
Subject: Re: OpenMCL
Date: Tue, 9 Dec 2003 08:18:11 +0100

Chris B. Vetter writes:
> On Mon, 8 Dec 2003 16:34:49 -0800 (PST)
> Calvin Mitchell <calvin674@yahoo.com> wrote:
> > ahhhh...so there ARE Common Lisp bindings for Objective-C!!!
> > <rubbing hands together>
> 
> Lisp? *shudder*

Yes. A small extract from the ccl/examples/cocoa-window.lisp:

http://openmcl.clozure.com/


(def-objc-class "lispapplication" "NSApplication")

(defloadvar *distant-past* [(@class "NSDate") "distantPast"])
(defloadvar *distant-future* [(@class "NSDate") "distantFuture"])
(defparameter *cocoa-event-poll-delay* 0.05d0)

(define-objc-method  ("nextEventMatchingMask:untilDate:inMode:dequeue:"
                      "lispapplication")
    (:unsigned mask :id date :id mode :<BOOL> dequeue :id)
  (let* ((date-not-in-future
          (<= (the double-float
                [date "timeIntervalSinceNow" :double-float])
              0.0d0))
         (soon [(@class "NSDate") "dateWithTimeIntervalSinceNow:"
                :double-float 0.02d0]))
    (rlet ((eventptr (* t)))
      (flet ((cocoa-event-poll ()
               (progn
                 (%setf-macptr
                  eventptr
                  [:super "nextEventMatchingMask:untilDate:inMode:dequeue:"
                          :unsigned mask
                          :id soon
                          :id mode
                          :<BOOL> dequeue])
                 (or (not (%null-ptr-p eventptr))
                     date-not-in-future))))
        (declare (dynamic-extent #'cocoa-event-poll))
        (process-wait "Cocoa Event Poll" #'cocoa-event-poll))
      eventptr)))


As soon  as I can get  GNUstep working again,  I'm going to work  on a
clisp or sbcl / GNUstep gateway.

> You're a sick, sick man...


-- 
__Pascal_Bourguignon__                              .  *   * . * .* .
http://www.informatimago.com/                        .   *   .   .*
                                                    * .  . /\  ()  . *
Living free in Alaska or in Siberia, a               . .  / .\   . * .
grizzli's life expectancy is 35 years,              .*.  / *  \  . .
but no more than 8 years in captivity.                . /*   o \     .
http://www.theadvocates.org/                        *   '''||'''   .
SCO Spam-magnet: postmaster@sco.com                 ******************




reply via email to

[Prev in Thread] Current Thread [Next in Thread]