Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!pipex!dircon!rheged!simon
From: simon@rheged.dircon.co.uk (Simon Brooke)
Subject: Re: Declare the type of the elements in a list?
Message-ID: <D37Kxp.52G@rheged.dircon.co.uk>
Organization: none. Disorganization: total.
References: <poeck-2801951904410001@wi6a65.informatik.uni-wuerzburg.de>
Date: Mon, 30 Jan 1995 08:00:59 GMT
Lines: 28

In article <poeck-2801951904410001@wi6a65.informatik.uni-wuerzburg.de>,
Karsten Poeck <poeck@informatik.uni-wuerzburg.de> wrote:
>I would like to define a type for a list of elements of a given type. For
>the sake of simplicity lets assume that the element type is fixnum and
>defined as:
>

The type of all elements in all lists in all LisPs is a given type,
to whit CONS-CELL.

You could of course define a new struct FIXNUMCONS or something, whose
first element was a fixnum and whose second element was a (possibly
null) pointer to another FIXNUMCONS. This would give you flat lists of
FIXNUMS only.

I think that what you should probably do is think a bit harder about
what you want to do. It seems improbable to me that there are any
circumstances under which you want some of the power of lists but not
all of the power of lists.

Cheers

Simon


-- 
------- simon@rheged.dircon.co.uk (Simon Brooke)

