[comp.lang.scheme] OOP in XScheme

STCS8004%IRUCCVAX.UCC.IE@MITVMA.MIT.EDU (10/18/90)

David  Betz describes  his XScheme  as 'An  object-oriented Scheme'  in the
manual he supplies  with the code [1], but that  manual contains no mention
of  OOP facilities.  However, OOP  commands are  present in  XScheme. Hence
these questions:

  1. Is  there  any  user-level  documentation  (not  the  source C code!)
     available on OOP in XScheme, and if so, where?

  2. Are  there any caveats regarding  the present state (I  have v0.22) of
     implementation of  OOP in XScheme?  (I am considering  using XScheme's
     OOP  in  teaching  since  our  students  use  XScheme for other Scheme
     applications.)

Thanks in advance for replies.

Gordon Oulsnam
STCS8004@IRUCCVAX.UCC.HEA.IE

[1] Net: BIX; Area: XLisp Listings

hultquis@nas.nasa.gov (Jeff P. M. Hultquist) (10/20/90)

>  2. Are  there any caveats regarding  the present state (I  have v0.22) of
>     implementation of  OOP in XScheme?  (I am considering  using XScheme's
>     OOP  in  teaching  since  our  students  use  XScheme for other Scheme
>     applications.)


This message reminded me to post (finally) about a recent 
bugfix which appeared in this forum ...


>>  Subject: xscheme object system bugs and fixes
>>  To: scheme@mc.lcs.mit.edu
>>  
>>  The second bug is in the function xsendsuper().  The lines:
>>  
>>      /* get the message class and the 'self' object */
>>      cls = getivar(getelement(car(cdr(obj)),0),SUPERCLASS);
>>      obj = car(obj);
>>  
>>  should be:
>>  
>>      /* get the message class and the 'self' object */
>>      obj = car(obj);
>>      cls = getivar(getclass(obj),SUPERCLASS);
>>  

This patch results in the re-sending of the message to the
superclass of the class of the object.  This is not very useful.

By changing the zero to a one, the message will be sent
to the superclass of the class in which the current method was
defined.  This is surely what was intended.

-- jeff




	


  
--
--
Jeff Hultquist				hultquis@nas.nasa.gov
NASA - Ames Research Center		(415) 604-4970
Disclaimer:  "I am not a rocket scientist."

hanche@imf.unit.no (Harald Hanche-Olsen) (10/21/90)

In article <9010190348.aa28638@mintaka.lcs.mit.edu> STCS8004%IRUCCVAX.UCC.IE@MITVMA.MIT.EDU writes:

   David  Betz describes  his XScheme  as 'An  object-oriented Scheme'  in the
   manual he supplies  with the code [1], but that  manual contains no mention
   of  OOP facilities.  However, OOP  commands are  present in  XScheme. Hence
   these questions:

     1. Is  there  any  user-level  documentation  (not  the  source C code!)
	available on OOP in XScheme, and if so, where?

Not as far as I know, but I didn't post just to tell you that...

     2. Are  there any caveats regarding  the present state (I  have v0.22) of
	implementation of  OOP in XScheme?  (I am considering  using XScheme's
	OOP  in  teaching  since  our  students  use  XScheme for other Scheme
	applications.)

Yes, David is still making major changes in the code, and the
object-oriented parts have been broken as a result at least once.  He
has stated publicly (on Bix) that he will not provide documentation
for the o-o stuff before he is convinced that it works.  So be
careful.

- Harald Hanche-Olsen <hanche@imf.unit.no>
  Division of Mathematical Sciences
  The Norwegian Institute of Technology
  N-7034 Trondheim, NORWAY

swyatt@brahms.udel.edu (Stephen L Wyatt) (10/23/90)

Does anyone know of any scheme compilers for an ibm pc computer? (preferrably something that is shareware/freeware.
thanks.

dleigh@hplabsz.HPL.HP.COM (Darren Leigh) (10/24/90)

In article <HULTQUIS.90Oct19141650@wk206.nas.nasa.gov> hultquis@nas.nasa.gov writes:

>>>  Subject: xscheme object system bugs and fixes
>
>This patch results in the re-sending of the message to the
>superclass of the class of the object.  This is not very useful.
>
>By changing the zero to a one, the message will be sent
>to the superclass of the class in which the current method was
>defined.  This is surely what was intended.

Jeff is correct here.  I sent out the broken send-super fix and a couple
of days later, someone mailed me some code that that didn't work.  I dug
through the code and discovered the real fix as well.  My face is red.
'Twas hubris on my part to suspect the amazing David Betz of an
abstraction violation rather than a typo.

The send-super fix that does work is what Jeff said:

In xsendsuper() just change:
      cls = getivar(getelement(car(cdr(obj)),0),SUPERCLASS);
to:
      cls = getivar(getelement(car(cdr(obj)),1),SUPERCLASS);

Darren Leigh
dleigh@hplabs.hp.com
hplabs!dleigh