Subject: Re: Access the the second return value?
From: Erik Naggum <erik@naggum.net>
Date: 2000/07/03
Newsgroups: comp.lang.lisp
Message-ID: <3171623893332559@naggum.net>

* "Janos Blazi" <jblazi@vipsurf.de>
| You always had to use zero terminated strings in C, there was no way
| to circuvent them

  Wrong.  The language does initialize literal strings in the code to
  be zero-terminated, but there's nothing that actually requires this
  apart from the standard C library.  Software written in C that does
  not use literals in the source code don't have to deal with this at
  all if they don't want to.  Several Pascal systems have used a
  length word (16 bits) before the data.  A simple way to deal with C
  and Pascal is thus to allocate three bytes too many, relative to the
  exact length, and write the length before the string and a zero byte
  after it.  Some Common Lisp systems also do this zero byte thing for
  the benefit of their FFIs.

| (it took me several minutes to figure out that in LDB the byte does
| not necessarily starts at a byte boundary; it is a powerful
| function).

  You would have spent less time if you had looked up "byte" in the
  glossary of the HyperSpec.  The 8-bit byte is a story of IBM taking
  over the meaning of perfectly good words.

| (The reason for zero terminated strings was that on their first
| machine (PDP?) they used hardwate to find such zeroes.)

  Wrong.  (Except in the trivial sense that one _always_ uses hardware
  when executing programs of any kind.)

| And in C++ zero terminated strings still were in use, though they
| became less important.

  Wrong.

  ISO/IEC 14882:1998(E) [lex.string] 2.13.4 String literals

4 After any necessary concatenation, in translation phase 7 (2.1),
  '\0' is appended to every string literal so that programs that scan
  a string can find its end.

| No, I did not know about this (as usual). So call it Lisp3.

  Why not just _drop_ this silliness?

#:Erik
-- 
  If this is not what you expected, please alter your expectations.