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
array input/output to files
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
  4 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
 
Erik Naggum  
View profile  
 More options Aug 15 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 1999/08/15
Subject: Re: array input/output to files
* go...@sip.medizin.uni-ulm.de (kp gores)
| how can i fix this?

  since the standard reader macro for arrays only creates simple arrays,
  you would need to call ADJUST-ARRAY afterwards to set further options, or
  create a specialized reader macro or even use #. and write out a call to
  MAKE-ARRAY with the :INITIAL-CONTENTS keyword to include the contents.

#:Erik
--
  (defun pringles (chips)
    (loop (pop chips)))


 
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.
Kent M Pitman  
View profile  
 More options Aug 15 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: 1999/08/15
Subject: Re: array input/output to files

go...@sip.medizin.uni-ulm.de (kp gores) writes:
> when reading from the file, the fill-pointer gets lost:
> [...]
> how can i fix this?

by not using read/print, which are not required to preserve the fill pointer.

 
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.
Erik Naggum  
View profile  
 More options Aug 16 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 1999/08/16
Subject: Re: array input/output to files
* kp gores
| why has the new array no fill-pointer?

  ADJUST-ARRAY is specified to signal an error if one attempts to add a
  fill-pointer to an array that doesn't have one.  sorry.

| 2nd: how would one create a reader macro?

  see SET-MACRO-CHARACTER and SET-DISPATCH-MACRO-CHARACTER.

#:Erik
--
  (defun pringles (chips)
    (loop (pop chips)))


 
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.
Erik Naggum  
View profile  
 More options Aug 18 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 1999/08/18
Subject: Re: array input/output to files
* go...@sip.medizin.uni-ulm.de (kp gores)
| to change the reader i have to modify the meaning of "#", right?

  no.

| (defun |#(-reader| (stream subchar arg)
|   (declare (ignore subchar arg))
|   (make-array :adjustable T
|               :fill-pointer T
|               :initial-contents (read stream t nil t)))

  try READ-DELIMITED-LIST, instead of READ.

| second, the arguments to make-array are wrong.

  yes, you would need to read the list first, then use its length as the
  dimension.

| i believe this are ignorant questions, but having never ever thought
| about modifying the reader, i have to ask for more help.

  I think you should hold back on modifying the reader.  it's not a good
  _first_ thing to try.

#:Erik
--
  (defun pringles (chips)
    (loop (pop chips)))


 
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 »