[Openmcl-devel] ns:ns-tracking-area not present in 32bit CCL

Gary Byers gb at clozure.com
Tue Jun 9 10:31:33 PDT 2009


You're right; EASYGUI (including that file) is loaded as the IDE is built.

DECLAIM's dictionary entry says that DECLAIM will have load-time effects
similar to the use of PROCLAIM, but that when it appears as a toplevel
form in a file being compiled those effects occur at compile-time; it
notes that the compile-time effects may or may not persist after the
file has been compiled.  (Implementations aren't required to limit
the extent of those compile-time effects, though those implementations
that I looked at a year or two ago all seemed to do so.)

Nothing that I've ever been able to find in the spec seems to allow
the implementation to limit the extent of the load-time effects of the
macroexpansion of a DECLAIM (presumably PROCLAIM or something very
much like it), and the description of PROCLAIM notes that it affects
the global environment (defined as "that part of an environment that
contains bindings with indefinite scope and indefinite extent.") and
that PROCLAIM's effects are always in effect unless locally shadowed.

Some implementations limit the extent of the load/execute-time effects
of a DECLAIM (so that those effects don't persist after the containing
file's been loaded), and there seems to be a lot of publically-available
code that assumes that behavior.  I don't think that that behavior's
correct (though I used to think that it was expedient enough to overlook
that.)  Among other things, it seems that it should be possible to load
a file which contains an OPTIMIZE declamation and have the effect to
that declamation persist.

Unfortunately (or not), that means that one must be careful to wrap
an (EVAL-WHEN (:COMPILE-TOPLEVEL) ...) around a declamation that's
intended to only have compile-time effects.






On Tue, 9 Jun 2009, Arthur W Cater wrote:

> I'm the guilty party for setting, persistently and unintentionally
> so,  those optimization settingsfrom within easygui views.lisp. Apologies to
> all concerned. I thought the compiler treated these
> declarations as affecting the subsequent contents of the source file in
> which they appeared
>  (modulo later declarations in the same overriding them), rather than
> causing the form to be
> given effect when loading the fasl; must I put it within (eval-when
> (:compile-toplevel) ...)?
> 
> I think that file gets loaded as part of (require 'cocoa-application), not
> as part of the
> startup of the ide-containing image.
> 
> Arthur
> 
> ----- Original Message -----
> From: Gary Byers <gb at clozure.com>
> Date: Tuesday, June 9, 2009 2:31 pm
> Subject: Re: [Openmcl-devel] ns:ns-tracking-area not present in 32bit CCL
> To: Ron Garret <ron at awun.net>
> Cc: openmcl-devel Devel <openmcl-devel at clozure.com>
> 
> > The code that sets the optimization settings (persistently and
> > probablynot intentionally so) is in
> > ccl/examples/cocoa/easygui/views.lisp.  For
> > reasons that I don't pretend to understand, that file is loaded
> > everytimethat the standalone IDE starts up, but isn't loaded or
> > referenced when
> > one just does (require "COCOA").
> >
> > That's my best guess; if it's not correct and it was more important
> > that I can imagine it to be to determine what other difference in
> > environment led to to different behavior, then I suppose that - armed
> > with knowledge of what all of those differences are - one could come
> > up with a more accurate explanation.
> >
> > I don't know.  To be honest, I don't really care; it seems
> > like the
> > time spent puzzling over this could be better spent trying to
> > fix the bug.
> >
> > On Tue, 9 Jun 2009, Ron Garret wrote:
> >
> > > Why is Rainer seeing this bug now and not me?  At this
> > point we're running
> > > the same code on the same CCL version on the same OS X version.
> > >
> > > rg
> > >
> > > On Jun 9, 2009, at 4:32 AM, Gary Byers wrote:
> > >
> > >> The bug's somewhat tersesly described in:
> > >>
> > >> <http://trac.clozure.com/openmcl/ticket/516>
> > >>
> > >> It's still open, though the code in the trunk version of the IDE
> > >> that was exposing/triggering the problem has been changed.
> > >>
> > >> That code can cause the IDE to start up with
> > >>
> > >> ;;;; see CLtL2; DECLARATION-INFORMATION didn't make it into
> > ANSI CL
> > >> ? (ccl:declaration-information 'optimize nil)
> > >> ((SPEED 0) (SAFETY 3) (COMPILATION-SPEED 0) (SPACE 0) (DEBUG 3))
> > >>
> > >> This combination of OPTIMIZE settings causes some rarely-executed
> > >> code to be executed, and the real bug is in that code.
> > >> (Of course, this should just have the effect of making the
> > code as
> > >> slow, bloated, and stupid as possible, but it incidentally exposes
> > >> a bug.)
> > >>
> > >> Untile the real bug is if fixed, you can work around the
> > problem by doing:
> > >>
> > >> ? (declaim (optimize (speed 1) (space 1) (safety 1) (debug 1)
> > >> (compilation-speed 1)))
> > >>
> > >> on startup.
> > >>
> > >>
> > >>
> > >>
> > >> On Tue, 9 Jun 2009, Rainer Joswig wrote:
> > >>
> > >>> Same error in  Clozure Common Lisp Version 1.3-
> > r12235M  (DarwinX8664).
> > >>>
> > >>> Mac OS X 10.5.7 on 64bit Intel...
> > >>>
> > >>>
> > >>> *** Error in event process: unknown arg spec :REGISTERS
> > >>>
> > >>> (442BE8) : 0 (FUNCALL #'#<(:INTERNAL |-[StandardView
> > drawRect:]|)>>>> #<SIMPLE-ERROR #x3000421B439D>) 85
> > >>> (#:G2965)
> > >>>  #:G2965: #<SIMPLE-ERROR #x3000421B439D>
> > >>>
> > >>> #:COMPILER-VAR: (NIL)
> > >>> #:G2962: #<A Foreign Pointer #x7FFF5FBFD360>
> > >>>
> > >>> (442C10) : 1 (SIGNAL #<SIMPLE-ERROR #x3000421B439D>) 981
> > >>> (CONDITION &REST CCL::ARGS)
> > >>>  CONDITION: #<SIMPLE-ERROR #x3000421B439D>
> > >>>  CCL::ARGS: NIL
> > >>>
> > >>> CCL::%HANDLERS%: ((ERROR) (ERROR))
> > >>> CCL::TAG: #<SIMPLE-ERROR #x3000421B439D>
> > >>> CCL::HANDLERS: CCL::*BACKTRACE-CONTEXTS*
> > >>> CCL::FN: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL |-[StandardView
> > >>> drawRect:]|) #x493DBF>
> > >>>
> > >>> (442C68) : 2 (%ERROR #<SIMPLE-ERROR #x3000421B439D>
> > (:REGISTERS)>>> 558482) 117
> > >>> (CONDITION CCL::ARGS CCL::ERROR-POINTER)
> > >>>  CONDITION: #<SIMPLE-ERROR #x3000421B439D>
> > >>>  CCL::ARGS: (:REGISTERS)
> > >>>  CCL::ERROR-POINTER: 558482
> > >>>
> > >>> ...
> > >>>
> > >>> Regards,
> > >>>
> > >>> Rainer Joswig
> > >>>
> > >>>
> > >>>
> > >>> Am 09.06.2009 um 07:02 schrieb Ron Garret:
> > >>>
> > >>>> Try updating.  The 1.3 branch is currently at verison
> > r12153M.  It
> > >>>> works for me on that version.
> > >>>>
> > >>>> rg
> > >>>>
> > >>>> On Jun 8, 2009, at 9:35 PM, Rainer Joswig wrote:
> > >>>>
> > >>>>>
> > >>>>>
> > >>>>> using Clozure Common Lisp Version 1.3-r12088M 
> > (DarwinX8664)>>>>>
> > >>>>>
> > >>>>> On executing the add-subview example form in draggable.lisp
> > >>>>>
> > >>>>> I get:
> > >>>>>
> > >>>>> *** Error in event process: unknown arg spec :REGISTERS
> > >>>>>
> > >>>>> (442BE8) : 0 (FUNCALL #'#<(:INTERNAL |-[StandardView
> > drawRect:]|)>>>>>> #<SIMPLE-ERROR #x3000420F8DBD>) 85
> > >>>>> (#:G5085)
> > >>>>> #:G5085: #<SIMPLE-ERROR #x3000420F8DBD>
> > >>>>>
> > >>>>> #:COMPILER-VAR: (NIL)
> > >>>>> #:G5082: #<A Foreign Pointer #x7FFF5FBFD360>
> > >>>>>
> > >>>>> (442C10) : 1 (SIGNAL #<SIMPLE-ERROR #x3000420F8DBD>) 981
> > >>>>> (CONDITION &REST CCL::ARGS)
> > >>>>> CONDITION: #<SIMPLE-ERROR #x3000420F8DBD>
> > >>>>> CCL::ARGS: NIL
> > >>>>>
> > >>>>> CCL::%HANDLERS%: ((ERROR) (ERROR))
> > >>>>> CCL::TAG: #<SIMPLE-ERROR #x3000420F8DBD>
> > >>>>> CCL::HANDLERS: CCL::*BACKTRACE-CONTEXTS*
> > >>>>> CCL::FN: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL |-
> > [StandardView>>>>> drawRect:]|) #x493DBF>
> > >>>>>
> > >>>>> (442C68) : 2 (%ERROR #<SIMPLE-ERROR #x3000420F8DBD>
> > (:REGISTERS)>>>>> 558482) 117
> > >>>>> (CONDITION CCL::ARGS CCL::ERROR-POINTER)
> > >>>>> CONDITION: #<SIMPLE-ERROR #x3000420F8DBD>
> > >>>>> CCL::ARGS: (:REGISTERS)
> > >>>>> CCL::ERROR-POINTER: 558482
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>> (442C90) : 3 (%FF-CALL 140735390423728 :REGISTERS #<NS-OBJECT
> > >>>>> <NSCFType: 0x170192c0> (#x170192C0)> :ADDRESS #<NS-
> > CONSTANT-STRING
> > >>>>> "Lisp Rules!" (#x137CD2F0)> :ADDRESS #<A Foreign Pointer
> > >>>>> #x7FFF82F59600> :ADDRESS #<NS-MUTABLE-DICTIONARY {
> > >>>>> NSFont = "TimesNewRomanPS-ItalicMT 48.00 pt. P [] (0x13799150)
> > >>>>> fobj=0x170178c0, spc=12.00";
> > >>>>> } (#x17019E50)> :VOID) 701
> > >>>>> (CCL::ENTRY &REST CCL::SPECS-AND-VALS)
> > >>>>> CCL::ENTRY: 140735390423728
> > >>>>> CCL::SPECS-AND-VALS: (:REGISTERS #<NS-OBJECT <NSCFType:
> > >>>>> 0x170192c0> (#x170192C0)> :ADDRESS #<NS-CONSTANT-STRING "Lisp
> > >>>>> Rules!" (#x137CD2F0)> :ADDRESS ...)
> > >>>>>
> > >>>>> CCL::LEN: 9
> > >>>>> CCL::TOTAL-WORDS: 0
> > >>>>> CCL::RESULT-SPEC: :VOID
> > >>>>> CCL::NARGS: 4
> > >>>>> CCL::N-FP-ARGS: 0
> > >>>>> CCL::I: 0
> > >>>>> CCL::SPECS: (:REGISTERS #<NS-OBJECT <NSCFType: 0x170192c0>
> > >>>>> (#x170192C0)> :ADDRESS #<NS-CONSTANT-STRING "Lisp
> > >>>>> Rules!" (#x137CD2F0)> :ADDRESS ...)
> > >>>>> CCL::SPEC: :REGISTERS
> > >>>>>
> > >>>>> (442CF8) : 4 (FUNCALL #'#<Anonymous Function
> > #x300041D9AB4F> #<NS-
> > >>>>> CONSTANT-STRING "Lisp Rules!" (#x137CD2F0)> #S(CCL::OBJC-
> > >>>>> SELECTOR :NAME "sizeWithAttributes:" :%SEL #<A Foreign
> > Pointer>>>>> #x7FFF82F59600>) #<NS-MUTABLE-DICTIONARY {
> > >>>>> NSFont = "TimesNewRomanPS-ItalicMT 48.00 pt. P [] (0x13799150)
> > >>>>> fobj=0x170178c0, spc=12.00";
> > >>>>> } (#x17019E50)>) 805
> > >>>>> (#:G3751 #:G3752 CCL::ARG0)
> > >>>>> #:G3751: #<NS-CONSTANT-STRING "Lisp Rules!" (#x137CD2F0)>
> > >>>>> #:G3752: #S(CCL::OBJC-SELECTOR :NAME "sizeWithAttributes:" :%SEL
> > >>>>> #<A Foreign Pointer #x7FFF82F59600>)
> > >>>>> CCL::ARG0: #<NS-MUTABLE-DICTIONARY {
> > >>>>> NSFont = "TimesNewRomanPS-ItalicMT 48.00 pt. P [] (0x13799150)
> > >>>>> fobj=0x170178c0, spc=12.00";
> > >>>>> } (#x17019E50)>
> > >>>>>
> > >>>>> #:G3753: #<NS-SIZE 0 X 0 #x3000420F8EDD> [gcable]
> > (#x17029190)>>>>> #:G3756: #<A Foreign Pointer #x17029190>
> > >>>>> #:G3755: #<NS-OBJECT <NSCFType: 0x170192c0> (#x170192C0)>
> > >>>>>
> > >>>>> (442D38) : 5 (FUNCALL #'#<(:INTERNAL CCL::SEND-
> > UNAMBIGUOUS-MESSAGE
> > >>>>> (SHARED-INITIALIZE :AFTER (CCL::OBJC-DISPATCH-FUNCTION
> > T)))> #<NS-
> > >>>>> CONSTANT-STRING "Lisp Rules!" (#x137CD2F0)> #<NS-
> > MUTABLE-DICTIONARY {
> > >>>>> NSFont = "TimesNewRomanPS-ItalicMT 48.00 pt. P [] (0x13799150)
> > >>>>> fobj=0x170178c0, spc=12.00";
> > >>>>> } (#x17019E50)>) 501
> > >>>>> (CCL::RECEIVER &REST CCL::ARGS)
> > >>>>> CCL::RECEIVER: #<NS-CONSTANT-STRING "Lisp Rules!"
> > (#x137CD2F0)>>>>>> CCL::ARGS: (#<NS-MUTABLE-DICTIONARY {
> > >>>>> NSFont = "TimesNewRomanPS-ItalicMT 48.00 pt. P [] (0x13799150)
> > >>>>> fobj=0x170178c0, spc=12.00";
> > >>>>> } (#x17019E50)>)
> > >>>>>
> > >>>>> CCL::SELECTOR: #S(CCL::OBJC-SELECTOR :NAME
> > "sizeWithAttributes:" :
> > >>>>> %SEL #<A Foreign Pointer #x7FFF82F59600>)
> > >>>>> FUNCTION: #<Anonymous Function #x300041D9AB4F>
> > >>>>>
> > >>>>> (442D78) : 6 (FUNCALL #'#<#<STANDARD-METHOD VIEW-
> > DRAW-CONTENTS
> > >>>>> (TEXT-VIEW)>> #<TESTVIEW #x30004201D12D> #<NS-RECT
> > 100 X 100 @ 0,0
> > >>>>> (#x7FFF5FBFD370) #x3000420F928D>) 229
> > >>>>> (V &OPTIONAL RECT)
> > >>>>> V: #<TESTVIEW #x30004201D12D>
> > >>>>> RECT: #<NS-RECT 100 X 100 @ 0,0 (#x7FFF5FBFD370)
> > #x3000420F928D>>>>>>
> > >>>>>
> > >>>>>
> > >>>>> (442DA0) : 7 (FUNCALL #'#<|-[StandardView drawRect:]|>
> > >>>>> 17591849974380) 981
> > >>>>> (#:G5081)
> > >>>>> #:G5081: 17591849974380
> > >>>>>
> > >>>>> #:G5088: #<A Foreign Pointer #x7FFF5FBFD360>
> > >>>>> #:G5082: #<A Foreign Pointer #x7FFF5FBFD360>
> > >>>>> #:COMPILER-VAR: (NIL)
> > >>>>> #:G5087: #<COMPILED-LEXICAL-CLOSURE (:INTERNAL |-
> > [StandardView>>>>> drawRect:]|) #x493DBF>
> > >>>>> #:G5089: (CONDITION #<COMPILED-LEXICAL-CLOSURE # #x493DBF>)
> > >>>>> CCL::%HANDLERS%: ((CONDITION #) (ERROR))
> > >>>>> SELF: #<STANDARD-VIEW <StandardView: 0x170221c0>
> > (#x170221C0)>>>>>> _CMD: #<A Foreign Pointer #x7FFF83013F38>
> > >>>>> RECT: #<NS-RECT 100 X 100 @ 0,0 (#x7FFF5FBFD370)
> > #x3000420F928D>>>>>>
> > >>>>> (442E48) : 8 (%PASCAL-FUNCTIONS% 277 17591849974380) 397
> > >>>>> (CCL::INDEX CCL::ARGS-PTR-FIXNUM)
> > >>>>> CCL::INDEX: 277
> > >>>>> CCL::ARGS-PTR-FIXNUM: 17591849974380
> > >>>>>
> > >>>>> CCL::LISP-FUNCTION: #<Compiled-function |-[StandardView
> > drawRect:]|>>>>> (Non-Global)  #x300041F007BF>
> > >>>>> WITHOUT-INTERRUPTS: NIL
> > >>>>> CCL::*CALLBACK-TRACE-P*: NIL
> > >>>>>
> > >>>>> (442F08) : 10 (FUNCALL #'#<Anonymous Function #x30004122027F>
> > >>>>> #<LISP-APPLICATION <LispApplication: 0x1c3580> (#x1C3580)>
> > >>>>> #S(CCL::OBJC-SELECTOR :NAME "run" :%SEL #<A Foreign Pointer
> > >>>>> #x7FFF82FFFD68>)) 205
> > >>>>> (#:G3072 #:G3073)
> > >>>>> #:G3072: #<LISP-APPLICATION <LispApplication:
> > 0x1c3580> (#x1C3580)>
> > >>>>> #:G3073: #S(CCL::OBJC-SELECTOR :NAME "run" :%SEL #<A Foreign
> > >>>>> Pointer #x7FFF82FFFD68>)
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>> (442F28) : 11 (FUNCALL #'#<(:INTERNAL CCL::SEND-
> > UNAMBIGUOUS-MESSAGE
> > >>>>> (SHARED-INITIALIZE :AFTER (CCL::OBJC-DISPATCH-FUNCTION
> > T)))> #<LISP-
> > >>>>> APPLICATION <LispApplication: 0x1c3580> (#x1C3580)>) 501
> > >>>>> (CCL::RECEIVER &REST CCL::ARGS)
> > >>>>> CCL::RECEIVER: #<LISP-APPLICATION <LispApplication:
> > 0x1c3580>>>>>> (#x1C3580)>
> > >>>>> CCL::ARGS: NIL
> > >>>>>
> > >>>>> CCL::SELECTOR: #S(CCL::OBJC-SELECTOR :NAME "run" :%SEL
> > #<A Foreign
> > >>>>> Pointer #x7FFF82FFFD68>)
> > >>>>> FUNCTION: #<Anonymous Function #x30004122027F>
> > >>>>>
> > >>>>> (442F68) : 12 (EVENT-LOOP NIL) 413
> > >>>>> (&OPTIONAL GUI::END-TEST)
> > >>>>> GUI::END-TEST: NIL
> > >>>>>
> > >>>>> GUI::APP: #<LISP-APPLICATION <LispApplication:
> > 0x1c3580> (#x1C3580)>
> > >>>>> *BREAK-ON-ERRORS*: NIL
> > >>>>> #:G163537: (ERROR)
> > >>>>> CCL::%HANDLERS%: ((ERROR))
> > >>>>> GUI::*EVENT-PROCESS-REPORTED-CONDITIONS*: (#<SIMPLE-ERROR
> > >>>>> #x3000420F8DBD>)
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>> Am 09.06.2009 um 02:44 schrieb Ron Garret:
> > >>>>>
> > >>>>>> [This may be a repeat, but the original never showed up
> > in my
> > >>>>>> inbox.  Also, there's an update at the end.]
> > >>>>>>
> > >>>>>> On Jun 8, 2009, at 11:32 AM, Arthur W Cater wrote:
> > >>>>>>
> > >>>>>>> Use #/addTrackingRect:owner:userData:assumeInside: with
> > >>>>>>> - the view
> > >>>>>>> - its #/bounds
> > >>>>>>> - a ns-object as target
> > >>>>>>> - ccl::+null-ptr+
> > >>>>>>> - #$NO
> > >>>>>>>
> > >>>>>>> Then
> > >>>>>>> (objc:define-objc-method ((:void :mouse-entered (:id event))
> > >>>>>>> <theTargetClassYouUsed>) ...)
> > >>>>>>>
> > >>>>>>> likewise :mouse-exited and :mouse-move
> > >>>>>>
> > >>>>>> Thanks!  Updated version enclosed. This has been
> > tested in 32-bit
> > >>>>>> CCL, and should now work on Tiger as well.
> > >>>>>>
> > >>>>>> This version also fixes a bug whereby testviews did not get
> > >>>>>> properly re-initialized to add a tracker when the class got
> > >>>>>> redefined.  I was using an initialize-instance
> > :after method when
> > >>>>>> I should have been using shared initialize -- I
> > think.  There is
> > >>>>>> still a subtle bug which I can't figure out.  When
> > you add a
> > >>>>>> highlighted mixin to an existing testview instance, you
> > have to
> > >>>>>> click on it once before it starts to highlight
> > itself.  I have no
> > >>>>>> idea why this is happening.  I may not be using
> > shared-initialize
> > >>>>>> properly.  Maybe a CLOS wizard can help with some
> > advice on the
> > >>>>>> proper way to do this.
> > >>>>>>
> > >>>>>> UPDATE: it turns out that the reason for this is that calling
> > >>>>>> shared-initialize is done lazily.  So until there is an
> > >>>>>> interaction with the updated object it doesn't get re-
> > initialized,>>>>>> so add-tracker doesn't get called, so the
> > event that would
> > >>>>>> normally cause the interaction never gets received. 
> > Makes an
> > >>>>>> interesting little puzzle.
> > >>>>>>
> > >>>>>> rg
> > >>>>>>
> > >>>>>> <draggable.lisp>
> > >>>>>> _______________________________________________
> > >>>>>> Openmcl-devel mailing list
> > >>>>>> Openmcl-devel at clozure.com
> > >>>>>> http://clozure.com/mailman/listinfo/openmcl-devel
> > >>>>>
> > >>>>> Rainer Joswig, Hamburg, Germany
> > >>>>> http://lispm.dyndns.org/
> > >>>>> mailto:joswig at lisp.de
> > >>>>>
> > >>>>>
> > >>>
> > >>> Rainer Joswig, Hamburg, Germany
> > >>> http://lispm.dyndns.org/
> > >>> mailto:joswig at lisp.de
> > >>>
> > >>>
> > >>>
> > >>> _______________________________________________
> > >>> Openmcl-devel mailing list
> > >>> Openmcl-devel at clozure.com
> > >>> http://clozure.com/mailman/listinfo/openmcl-devel
> > >>>
> > >>>
> > >> _______________________________________________
> > >> Openmcl-devel mailing list
> > >> Openmcl-devel at clozure.com
> > >> http://clozure.com/mailman/listinfo/openmcl-devel
> > >
> > _______________________________________________
> > Openmcl-devel mailing list
> > Openmcl-devel at clozure.com
> > http://clozure.com/mailman/listinfo/openmcl-devel
> 
>



More information about the Openmcl-devel mailing list