From: Janos Blazi
Subject: Windows GUI woth Corman Lisp 2.0
Date: 
Message-ID: <3df88695$1_1@news.newsgroups.com>
The first example program in the package uses CLOS (if I understand this
correctly):

(defclass <hello-window> (<frame>)
 ((text-rect :accessor hello-text-rect :initform (ct:malloc (sizeof
'RECT)))))

(defun hello ()
 (let ((window (make-instance '<hello-window>)))
  (create-window window
   :caption "hello"
   :style (logior WS_OVERLAPPEDWINDOW WS_MINIMIZEBOX))
  (show-window window SW_SHOW)
  (update-window window)
  (standard-message-loop)))

(defmethod handle-message ((window <hello-window>) (message <paint-message>)
wparam lparam)
 (declare (ignore message wparam lparam))
 (let ((rect (hello-text-rect window)))
  (GetClientRect (window-hwnd window) rect)
  (DrawText (window-hdc window)
   (ct:create-c-string "Hello, World")
   -1
   rect
   (logior DT_SINGLELINE DT_CENTER DT_VCENTER)))
 0)

Can I do this /without/ classes?

TIA,
Janos Blazi





-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
   http://www.newsfeed.com       The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----

From: Kenny Tilton
Subject: Re: Windows GUI woth Corman Lisp 2.0
Date: 
Message-ID: <3DF8A58F.5020005@nyc.rr.com>
Janos Blazi wrote:
> The first example program in the package uses CLOS (if I understand this
> correctly):
> 
...snip...

> 
> Can I do this /without/ classes?

Win32 per se has a procedural interface, so via the FFI you can call 
CreateWindowEx, supply your own WindProc callback to handle all the 
messages, ie, do it all yourself as if you were a C programmer (just 
grab a good C Win32[*] book and go).

That, btw, is what I will do for Cello if FreeGlut won't work. But if I 
just wanted to build one app on one platform, I would use the Corman 
handi-wrapper.

[*] Actually, Dan Appleman's Win32 for VB book is quite good as well, 
but a C-based tome might have some advantages.
From: Hannah Schroeter
Subject: Style (was Re: Windows GUI woth Corman Lisp 2.0)
Date: 
Message-ID: <atabmp$h64$1@c3po.schlund.de>
Hello!

Janos Blazi <······@hotmail.com> wrote:

>(defclass <hello-window> (<frame>)
> ((text-rect :accessor hello-text-rect :initform (ct:malloc (sizeof
>'RECT)))))

>[...]

When seeing your example, I thought "it's a nice way to distinguish
class names by some visual indicator, like the example did".

It looks like the angle brackets could be inspired by Dylan's
conventions.

What do others think? Do you tend to put a visual indicator on
class names or not? And why is that your preference?

Kind regards,

Hannah.
From: Janos Blazi
Subject: Re: Style (was Re: Windows GUI woth Corman Lisp 2.0)
Date: 
Message-ID: <3df8b5d5_1@news.newsgroups.com>
> When seeing your example, I thought "it's a nice way to distinguish
> class names by some visual indicator, like the example did".

It was not "my example", it was the official example. This time I am really
innocent. I thought that those brackets have some syntactical significance I
do not know.

> It looks like the angle brackets could be inspired by Dylan's
> conventions.

When I was yound, I liked Dylan very much: "And if my thought dreams could
be seen, they'd probably put my head in a guillotine, but it's allright ma,
I'm only sighing."
(This time I am not innocent.)

JB




-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
   http://www.newsfeed.com       The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
From: Kenny Tilton
Subject: Re: Style (was Re: Windows GUI woth Corman Lisp 2.0)
Date: 
Message-ID: <3DF8DDD8.20306@nyc.rr.com>
Hannah Schroeter wrote:
> What do others think? Do you tend to put a visual indicator on
> class names or not? And why is that your preference?

Thx for asking so I can be burned at the stake here:

(defmodel IXGrid (IXTable)
   ((colCt...)(whatEver...)...

classes and slotnames are studly, starting with caps for class names, 
lowercase for slotnames. functions get hypens, macros are studly, except 
for with-what-ever in deference to (wait for it) Lisp tradition.

I did like the <thing> when I first saw it looking at Dylan just before 
I found CL.

-- 

  kenny tilton
  clinisys, inc
  http://www.tilton-technology.com/
  ---------------------------------------------------------------
"Cells let us walk, talk, think, make love and realize the bath water is 
cold."
                                                   -- Lorraine Lee Cudmore
From: Alain Picard
Subject: Re: Style (was Re: Windows GUI woth Corman Lisp 2.0)
Date: 
Message-ID: <878yyvrkmn.fsf@optushome.com.au>
······@schlund.de (Hannah Schroeter) writes:

> Janos Blazi <······@hotmail.com> wrote:
>
>>(defclass <hello-window> (<frame>)

> When seeing your example, I thought "it's a nice way to distinguish
> class names by some visual indicator, like the example did".
>
> What do others think? Do you tend to put a visual indicator on
> class names or not? And why is that your preference?

I do not.  I'm trying to think of a case where such a visual
marker would be of help; usually, when dealing with classes,
you either have the situation:

(defclass my-class (other-classes)  ;  pretty obvious that my-class
  ...)                              ;  is a class

(defmethod blah ((thing my-class))  ;  ditto

or even

(find-class 'my-class)              ;  doh!
(find-class '<my-class>)            ;  ? Yuck!!!

So it comes down to cases where do
do things like

(defun grovel (thing)
    ...
    (let ((class (find-class (class-of thing))))
      ...
    )

where the actual class is never seen (and, if it was,
it would print as #<CLASS MY-THING: ...>.

So I'm not sure how it would help.

Just my .02 AUD.  

[To Kenny: StudlyCappers should be KneeCapped.  :-]
From: Chris Double
Subject: Re: Style (was Re: Windows GUI woth Corman Lisp 2.0)
Date: 
Message-ID: <u65tx1i9n.fsf@double.co.nz>
······@schlund.de (Hannah Schroeter) writes:

> When seeing your example, I thought "it's a nice way to distinguish
> class names by some visual indicator, like the example did".

I'm probably the one responsible for the appearance of the angle
brackets in the example since I did the original GUI example code for
Corman Lisp which Roger has since expanded on.

> It looks like the angle brackets could be inspired by Dylan's
> conventions.

That's exactly it. I'm a Dylan programming who came to Common Lisp,
and used that style convention.

> 
> What do others think? Do you tend to put a visual indicator on class
> names or not? And why is that your preference?

In more recent code I no longer use this idiom. Mainly to fit into
more of the Common Lisp style guidelines than anything else.

Chris.
-- 
http://www.double.co.nz
From: Roger Corman
Subject: Re: Style (was Re: Windows GUI woth Corman Lisp 2.0)
Date: 
Message-ID: <3dfb9a1b.1208306893@news.sf.sbcglobal.net>
I hadn't seen this before I got Chris' code--but I do kind of like it.
It sure sets class names apart.

Roger
--------------------------------------------------------------------------------------------------------------
On 14 Dec 2002 14:49:56 +1300, Chris Double <·····@double.co.nz> wrote:

>······@schlund.de (Hannah Schroeter) writes:
>
>> When seeing your example, I thought "it's a nice way to distinguish
>> class names by some visual indicator, like the example did".
>
>I'm probably the one responsible for the appearance of the angle
>brackets in the example since I did the original GUI example code for
>Corman Lisp which Roger has since expanded on.
>
>> It looks like the angle brackets could be inspired by Dylan's
>> conventions.
>
>That's exactly it. I'm a Dylan programming who came to Common Lisp,
>and used that style convention.
>
>> 
>> What do others think? Do you tend to put a visual indicator on class
>> names or not? And why is that your preference?
>
>In more recent code I no longer use this idiom. Mainly to fit into
>more of the Common Lisp style guidelines than anything else.
>
>Chris.
>-- 
>http://www.double.co.nz