🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.clos
Article #550

Type declarations and generic classes in CLOS - HOW??

#550
From: Fernando Mato Mira
Date: Mon, 16 Nov 1992 17:25
30 lines
1680 bytes
Let's say you have a class:
(defclass foo () ((x :accessor x :type number)))


and you would like to be able to do something like:
(proclaim (type (foo integer) an-instance))


so a smart LISP compiler can avoid type checking when you write:
(proclaim (type integer n))
(setf n (x an-instance))

How would you go about? It seems that generic classes (and the general issue of
type declarations - see article "Declaring types by association in CLOS")
have been overlooked in the design of CLOS.

I am trying to do VR, so every declaration counts.

I remember a paper by Luca Cardelli on an implementation of ML with a
higher-order type system. Shouldn't LISP have something like that to
stay at the cutting edge?

-- 
Fernando D. Mato Mira
Computer Graphics Lab			   "I must admit it, I have learned
Swiss Federal Institute of Technology	        some things from Eiffel"
matomira@di.epfl.ch

NeXTMail : matomira@lignext.epfl.ch
FAX 	 : +41 (21) 693 - 5328
Technical Details
Message-ID: <1992Nov16.182518@disuns2.epfl.ch>
Path: arc1-ca.pugleaf.net!sparky!uunet!ferkel.ucsb.edu!taco!rock!stanford.edu!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!rpi!ghost.dsi.unimi.it!univ-lyon1.fr!chx400!sicsun!disuns2!/!matomira

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ferkel.ucsb.edu!taco!rock!stanford.edu!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!rpi!ghost.dsi.unimi.it!univ-lyon1.fr!chx400!sicsun!disuns2!/!matomira
From: matomira@disuns2.epfl.ch (Fernando Mato Mira)
Newsgroups: comp.lang.clos,comp.lang.lisp,comp.lang.eiffel
Subject: Type declarations and generic classes in CLOS - HOW??
Summary: Here we go again...
Message-ID: <1992Nov16.182518@disuns2.epfl.ch>
Date: 16 Nov 92 17:25:18 GMT
Sender: news@disuns2.epfl.ch
Reply-To: matomira@disuns2.epfl.ch (Fernando Mato Mira)
Followup-To: comp.lang.clos
Organization: Ecole Polytechnique Federale de Lausanne
Lines: 30
Nntp-Posting-Host: disun47.epfl.ch