🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by john Thu, 15 Oct 1992 16:52
FIXNUM declarations (was How to neatly destroy instances)
#345
Author: john
Date: Thu, 15 Oct 1992 16:52
26 lines
1276 bytes
Jeff Dalton (jeff@aiai.edinburgh.ac.uk) writes:

  ...  For instance, why should I write code for vectors with as many
  as, say, 1000 elements when I can write instead for "vectors as big
  as this Lisp can handle"?  Why should I have to pick a number?

Well, this probably only works for that particular example, but you
can always build implementation constants into your own type
definitions:

  (DEFTYPE VECTOR-INDEX ()
    '(INTEGER 0 #.(1- ARRAY-TOTAL-SIZE-LIMIT)))

  (DEFUN TRAVERSE-VECTOR (V)
    (DECLARE (TYPE VECTOR V))
    (DOTIMES (I (1- (LENGTH V)))
      (DECLARE (TYPE VECTOR-INDEX I))
      ...
      (ELT V I)
      ...))

I do this all the time.  Then again, by type inference, the compiler
SHOULD be able to figure out the range of I anyway.

John Burger
john@mitre.org
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads