[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Re: Updated objc-header.scm
From: |
Zbigniew |
Subject: |
[Chicken-users] Re: Updated objc-header.scm |
Date: |
Tue, 13 Jun 2006 14:31:57 -0500 |
Kon,
I've been away for a bit and am just now catching up on my email
backlog. It looks like a interesting idea. However, I'm curious why
you made NSString* and so on into macros that generate 'objc:ID etc.,
instead of using variables. In other words:
#;2> (define objc:NSString* objc:ID)
#;3> (define-objc-class ABCD NSObject ()
(+ NSString* hello
(print "hi")
"ooga"))
#;4> (@ ABCD hello)
hi
@"ooga"
#;5>
Is this approach workable? Do you want the extra parens to emulate
the look of Objective C, or find the macros are necessary?
As an aside, the function macro:type->encoding provides some control
over this conversion; the default behaviour---prepend objc: to
symbols, pass the rest through---allows you to evaluate functions or
pass encoded typestrings directly. It is possible to augment this to
provide alternate syntax, for example when you pass a list; your
macros do effectively the same job, with just a bit of namespace
pollution.
The only qualm I have about allowing type-like symbols instead of
plain ID and PTR is that it gives the erroneous impression of
typechecking, whereas ID and PTR spell this out. I guess it comes
down to user preference and, ultimately, can be loaded if the user so
desires.
On 6/3/06, Kon Lovett <address@hidden> wrote:
Hello again,
Attached is an updated source that allows a coding style like the
following:
(- (NSString*) windowNibName
(- VOID ((#:windowControllerDidLoadNib (NSWindowController*)
aController))
(- BOOL ((#:readFromData (NSData*) data) (#:ofType (NSString*) aType)
(#:error (NSError**) outerr))
(- (IBAction) ([#:eval ID sender])
Best Wishes,
Kon