home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!sdd.hp.com!think.com!barmar
- From: barmar@think.com (Barry Margolin)
- Newsgroups: comp.lang.lisp
- Subject: Re: portable O(1) strlen
- Date: 13 Aug 1992 09:18:05 GMT
- Organization: Thinking Machines Corporation, Cambridge MA, USA
- Lines: 19
- Message-ID: <16d9cdINNmde@early-bird.think.com>
- References: <19247@ector.cs.purdue.edu>
- NNTP-Posting-Host: gandalf.think.com
- Keywords: strlen, format, AKCL
-
- In article <19247@ector.cs.purdue.edu> yeh@cs.purdue.EDU (Wei Jen Yeh) writes:
- >Hello,
- > I just found a bug in my program caused by thinking that
- > (array-dimension (format NIL "1234") 0) = 4.
-
- Is FORMAT returning a longer string with a fill pointer? I thought that
- functions that create strings were supposed to return simple strings. What
- Lisp does this?
-
- >So, is there a portable O(1) STRLEN?
-
- LENGTH is O(1) when the argument is a vector, although the coefficient will
- usually be higher than ARRAY-DIMENSION, since it has to check whether the
- argument is a vector or list, and whether it has a fill pointer.
- --
- Barry Margolin
- System Manager, Thinking Machines Corp.
-
- barmar@think.com {uunet,harvard}!think!barmar
-