Newsgroups: comp.lang.lisp.x
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!howland.reston.ans.net!math.ohio-state.edu!caen!hearst.acc.Virginia.EDU!murdoch!usenet
From: "Steven D. Majewski" <sdm7g@Virginia.EDU>
Subject: compound-object-proto's in xlisp-stat
X-Sender: sdm7g@elvis.med.Virginia.EDU
X-Nntp-Posting-Host: elvis.med.virginia.edu
Content-Type: TEXT/PLAIN; charset=US-ASCII
Message-ID: <Pine.A32.3.90.950628090307.1773A-100000@elvis.med.Virginia.EDU>
To: Xlisp List <stat-lisp-news@umnstat.stat.umn.edu>
Sender: usenet@murdoch.acc.Virginia.EDU
Organization: University of Virginia
Mime-Version: 1.0
Date: Wed, 28 Jun 1995 13:33:46 GMT
Lines: 50


One big advantage of languages that are O-O "all the way down" - like
smalltalk, oaklisp ( or, I assume Dylan ) are that it is  easy to
seamlessly extend the basic data types.

Python ( like Xlisp, CLOS & C++, a hybrid O-O language ) does not
allow inheritance from it's built-in data types, but it does 
support abstract data typing: for example, if you define several
methods for a user written class like __getitem__, __setitem__,
__len__ ( and a couple of others ), then you can use objects of 
that class in place of built in sequences ( or, if you overload
__add__, __mul__, __sub__, __div__, etc. as a new numeric type. )

This is a capability that I have been missing in xlisp-stat. 

Reading the description of compound-data-proto in the xlisp-stat
book, I had thought that I had discovered a way to do this, 
at least for sequences, in xlisp stat. However, it appears that
this only works for the explicitly vectorized operations. 
[ Discovered after I had rewritten my classes into being extended
  compound-data-proto prototypes! ]

	( * 2.0 cdata0 ) and ( + cdata1 cdata2 ) 

works for compound-data-objects cdata*, but :

	( plot-lines x cdata )
	( elt cdata n ) 
	( coerce 'cons cdata )
	( map 'vector #'func cdata1 cdata2 )

for example, all fail. 

My guess is that this "fault-line" represents a division between
the vectorized operations added by xlisp-stat and the base operations
of xlisp. 

* Are there any plans to extend this capability to make compound
  data proto objects to become 1st class sequence objects ? 

* Is there some other simple way to do what I want? 
  ( where simple means NOT trying to track down and rewrite 
    all of the necessary functions! )


---|  Steven D. Majewski   (804-982-0831)  <sdm7g@Virginia.EDU>  |---
---|  Computer Systems Engineer          University of Virginia  |---
---|  Department of Molecular Physiology and Biological Physics  |---
---|  Box 449 Health Science Center    Charlottesville,VA 22908  |---

