Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

read-sequence & ACL

13 views
Skip to first unread message

Barry Margolin

unread,
Dec 24, 1998, 3:00:00 AM12/24/98
to
In article <m37lvi7...@eho.eaglets.com>,
Sam Steingold <s...@goems.com> wrote:
>`read-sequence' is under-specified: it is unclear whether it reads bytes
>or chars, so ACL5 refuses to read-sequence from a socket to a vector of

I would expect it to read whatever the stream's element type is, which must
be compatible with the element type of the sequence.

That's what I wrote about a month ago, when you brought up this same issue
(I found replies from me and Erik on DejaNews, but not your original post
-- do you use x-no-archive?)

--
Barry Margolin, bar...@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Don't bother cc'ing followups to me.

Erik Naggum

unread,
Dec 24, 1998, 3:00:00 AM12/24/98
to Sam Steingold
* Sam Steingold <s...@goems.com>

| `read-sequence' is under-specified: it is unclear whether it reads bytes
| or chars, so ACL5 refuses to read-sequence from a socket to a vector of
| unsigned-byte.

Sam Steingold is under-intelligent: it is unclear whether he can read a
single bit of documentation, or, god forbid, a sequence of characters, so
ACL 5.0 refuses to do what he tries to pound it into doing. but since
it's Christmas, let's even help the retarded with Common Lisp questions.

| is there a way around this?

yeah, there actually is. you could (re)boot your brain, read the very
good documentation and the standard, think for maybe 14 ms if you're
really slow, and then not post the same stupid question anymore since you
would have understood the point. oh, you meant around _your_ problem.
well, my suggestion actually works for yours, too.

but, in the spirit of Christmas and all, here's a gift quote from the
Description clause in the standard under READ-SEQUENCE:

Destructively modifies sequence by replacing the elements of sequence
bounded by start and end with elements read from stream.

"element" is a glossary term. let's look it up. aaah, there's a special
case just for us! that's _so_ nice, don't you think? now, read it.

element n. ... 5. (of an input stream) a character or number (as
appropriate to the element type of the stream) that is among the ordered
series of objects that can be read from the stream (using read-char or
read-byte, as appropriate to the stream).

and here's _another_ sentence, now in the Exceptional Situations clause
in the standard under READ-SEQUENCE:

Might signal an error of type type-error if an element read from the stream
is not a member of the element type of the sequence.

what _could_ this _possibly_ mean? could it be that element types of
streams and sequences have to agree? nah, that would be quite smart, and
some people just _aren't_ smart at all, now, are they? just getting the
idea that objects in Common Lisp are _typed_ and that type mismatches are
fixable by getting the types right is obviously too much for some people.

| what do I do?

well, since you appear to be the kind of guy who copies examples instead
of understanding them, and I'm nice to you today, it being Christmas and
all, here's one example so trivial that even copyright protection won't
apply to it. it has worked as long as I have used Allegro CL, i.e., from
4.3 through 5.0:

(let ((universal-time (make-array 4 :element-type '(unsigned-byte 8))))
(with-open-stream (time (socket:make-socket :FORMAT :BINARY
:remote-host "127.1"
:remote-port "time"))
(read-sequence universal-time time))
universal-time)

please excuse the lack of boldface. I have tried to highlight the
important aspect of this example with uppercase letters, instead. I hope
that is sufficient for you when you copy the example. feel free to
complain about case insensitivity, by the way, if the example doesn't
work until you downcase the two symbols.

| [CLISP provides lisp:read-byte-sequence and lisp:read-char-sequence for
| this exact purpose.]

another great disservice to the Common Lisp community from CLISP, by
people who don't really understand what's going on around them.

#:Erik
--
Nie wieder KrF! Nie wieder KrF! Nie wieder KrF! Nie wieder KrF!

rusty craine

unread,
Dec 24, 1998, 3:00:00 AM12/24/98
to

Erik Naggum wrote in message <31234762...@naggum.no>...

> it's Christmas, let's even help the retarded with Common Lisp

Common Lisp for the retarded ---- at last a course I can take.

> .... you could (re)boot your brain,

hmmmm methylphenidate 10 mg twice daily ??

> good documentation and the standard, think for maybe 14 ms if you're
> really slow, and then not post the same
>

As Dilbert should have said..."the only good documentation is that
documentation you don't have to read". Does it have pictures?

> but, in the spirit of Christmas and all, here's a gift quote from the


Note to file...don't post question on October 31

Rusty (The Worm)

Erik Naggum

unread,
Dec 25, 1998, 3:00:00 AM12/25/98
to
* "rusty craine" <rccr...@flash.net>

| hmmmm methylphenidate 10 mg twice daily ??

personally, I restrict myself to 1,3,7-trimethylxanthine.

| Note to file...don't post question on October 31

*laugh*

rusty craine

unread,
Dec 25, 1998, 3:00:00 AM12/25/98
to

Erik Naggum wrote:

> * "rusty craine" <rccr...@flash.net>
> | hmmmm methylphenidate 10 mg twice daily ??
>
> personally, I restrict myself to 1,3,7-trimethylxanthine.

ahhh the xanthines...a wonderful group of compounds, most useful. From
CNS stimulants, broncho-dilators to antibiotics. Which reminds me, some
years ago Alcon, a local manufactor of ophthamlic drugs, was working on
a molecular modeling (remodeling, acutally) program on TI's lisp
machine. They called me to consult a couple of times on the project.
The lisp programs to drive the molecular transformations were not to
difficult but the graphics representations were far above my abilities
(think they finally called in some TI help or the Houston U group, can't
remember). Still lisp by it's nature is one of the best tools to use
for such tasks. Think I'll give it a go again in Mr Corman's lisp for
wndows.

Know of any current efforts in lisp and molecular mechanics?

Rusty (the Worm)

Not that it matters but I got the nick-name "The Worm" from a
colleague who was debugging one of my _less_ outstanding examples of
lisp. When ask how the debugging was going he commented that he hadn't
got to the debugging yet, he was still de-worming. I keep the nick-name
around just to keep me humble. ;-)


Erik Naggum

unread,
Dec 25, 1998, 3:00:00 AM12/25/98
to
* Erik Naggum

| personally, I restrict myself to 1,3,7-trimethylxanthine.

* rusty craine <rccr...@flash.net>


| ahhh the xanthines...a wonderful group of compounds, most useful.

1,3,7-trimethylxanthine is caffeine. I thought you'd know that.

rusty craine

unread,
Dec 25, 1998, 3:00:00 AM12/25/98
to

Erik Naggum wrote:

> * Erik Naggum
> | personally, I restrict myself to 1,3,7-trimethylxanthine.
>
> * rusty craine <rccr...@flash.net>
> | ahhh the xanthines...a wonderful group of compounds, most useful.
>
> 1,3,7-trimethylxanthine is caffeine. I thought you'd know that.
>

Yes, in general the group of coumpounds know as xanthines include
caffine, theophylline, all way to a antiboitc roughly based on the
xanthine molecule (Cipro). There is even a xanthine (Trental - generic
pentoxifylline) used in chornic occlusive arterial disease. Very useful
group of drugs and they all have caffine as their base moelcule.

Rusty

Rob Warnock

unread,
Dec 26, 1998, 3:00:00 AM12/26/98
to
rusty craine <rccr...@flash.net> wrote:
+---------------

| Know of any current efforts in lisp and molecular mechanics?
+---------------

Well, there's a small yet quite interesting molecular "CAD" package called
"NanoCAD", by Will Ware, that was originally written in Scheme[*]
that you might find interesting:

http://world.std.com/~wware/ncadlisp.html
http://world.std.com/~wware/nanocad-0.2-doc.html

The screen shot at the top of that page shows most of it, except you can
also click-and-drag to move/rotate the displayed molecule. An older version
of it also comes in the "collects/mrdemo/" directory of the MrEd distribution.
I just fired up the one that came with MrEd v.51, and in about 10 minutes
built some C7H12 (a simple linear chain with two double bonds) and ran a
couple of "energy minimization" passes on it (the "Emin" button), and then
tilted it around a bit to look at it. It's pretty cute. [The "NanoCAD"
package, I mean, not my silly little molecule...]


-Rob

[*] Actually, MzScheme, extended with the MrEd package which includes the C++
"WxWindows" graphics classes. but I digress... Originally in Scheme, but
re-written in Java. (*sigh*) See <URL:http://world.std.com/~wware/ncad.html>.
However, the original Scheme version is still available.

-----
Rob Warnock, 8L-855 rp...@sgi.com
Applied Networking http://reality.sgi.com/rpw3/
Silicon Graphics, Inc. Phone: 650-933-1673
2011 N. Shoreline Blvd. FAX: 650-964-0811
Mountain View, CA 94043 PP-ASEL-IA


0 new messages