Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
do streams for bytes and strings exist?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Florian Dietz  
View profile  
 More options Oct 26 2012, 5:50 am
Newsgroups: comp.lang.lisp
From: Florian Dietz <floriandiet...@googlemail.com>
Date: Fri, 26 Oct 2012 02:50:09 -0700 (PDT)
Local: Fri, Oct 26 2012 5:50 am
Subject: do streams for bytes and strings exist?
I am writing a serializer for some objects and I can't seem to be able to write and read both bytes and strings to the file. It's an either-or question, depending on what type of stream I take.

Am I overlooking something? What is the best way to do this?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zach Beane  
View profile  
 More options Oct 26 2012, 7:07 am
Newsgroups: comp.lang.lisp
From: Zach Beane <x...@xach.com>
Date: Fri, 26 Oct 2012 07:07:08 -0400
Local: Fri, Oct 26 2012 7:07 am
Subject: Re: do streams for bytes and strings exist?

Florian Dietz <floriandiet...@googlemail.com> writes:
> I am writing a serializer for some objects and I can't seem to be able
> to write and read both bytes and strings to the file. It's an
> either-or question, depending on what type of stream I take.

> Am I overlooking something? What is the best way to do this?

There is no standard way. Many implementations support "bivalent
streams" that can take both binary and character operations. In the
absence of bivalent streams, it's typical to use a binary stream (with
an element type of (unsigned-byte 8)) and convert characters and strings
to the appropriately encoded octet vector before writing them to the
stream.

Zach


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Frode V. Fjeld  
View profile  
 More options Oct 26 2012, 7:35 am
Newsgroups: comp.lang.lisp
From: "Frode V. Fjeld" <frod...@gmail.com>
Date: Fri, 26 Oct 2012 13:35:34 +0200
Local: Fri, Oct 26 2012 7:35 am
Subject: Re: do streams for bytes and strings exist?

Florian Dietz <floriandiet...@googlemail.com> writes:
> I am writing a serializer for some objects and I can't seem to be able
> to write and read both bytes and strings to the file. It's an
> either-or question, depending on what type of stream I take.

> Am I overlooking something? What is the best way to do this?

I'd suggest using the FLEXI-STREAMS library.

--
Frode V. Fjeld


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Florian Dietz  
View profile  
 More options Oct 26 2012, 8:45 am
Newsgroups: comp.lang.lisp
From: Florian Dietz <floriandiet...@googlemail.com>
Date: Fri, 26 Oct 2012 05:45:11 -0700 (PDT)
Local: Fri, Oct 26 2012 8:45 am
Subject: Re: do streams for bytes and strings exist?
Am Freitag, 26. Oktober 2012 13:07:09 UTC+2 schrieb Zach Beane:

Thanks, I went with this and wrote some macros.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zach Beane  
View profile  
 More options Oct 26 2012, 8:47 am
Newsgroups: comp.lang.lisp
From: Zach Beane <x...@xach.com>
Date: Fri, 26 Oct 2012 08:47:52 -0400
Local: Fri, Oct 26 2012 8:47 am
Subject: Re: do streams for bytes and strings exist?

Frodef's suggestion is good, too. Flexi-streams are handy.

Zach


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »