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
remove-if and fill-pointer
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
  6 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
 
joachim  
View profile  
 More options Nov 29 2002, 10:20 am
Newsgroups: comp.lang.lisp
From: joac...@arti.vub.ac.be
Date: 29 Nov 2002 16:23:54 +0100
Local: Fri, Nov 29 2002 10:23 am
Subject: remove-if and fill-pointer

Hello,

I noticed that when using remove,remove-if etc. functions on an
adjustable array or an array with a fill-pointer, the result is an
array _without_ a fill-pointer and that is not adjustable.

Why is this?

And is there a way to remove elements from (the interior of a)
fill-pointer array and still have a fill-pointer array as the result
without defining a new fill-pointer-remove-if function or redefining
remove-if etc. ?

Thanks, Joachim.


 
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.
Paul F. Dietz  
View profile  
 More options Nov 29 2002, 10:31 am
Newsgroups: comp.lang.lisp
From: "Paul F. Dietz" <di...@dls.net>
Date: Fri, 29 Nov 2002 09:32:56 -0600
Local: Fri, Nov 29 2002 10:32 am
Subject: Re: remove-if and fill-pointer

joac...@arti.vub.ac.be wrote:
> Hello,

> I noticed that when using remove,remove-if etc. functions on an
> adjustable array or an array with a fill-pointer, the result is an
> array _without_ a fill-pointer and that is not adjustable.

> Why is this?

Because the standard requires it:

Section 17.1:

"A sequence function is a function defined by this specification or
  added as an extension by the implementation that operates on one or
  more sequences. Whenever a sequence function must construct and return
  a new vector, it always returns a simple vector. Similarly, any strings
  constructed will be simple strings."

        Paul


 
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.
joachim  
View profile  
 More options Nov 29 2002, 10:50 am
Newsgroups: comp.lang.lisp
From: joac...@arti.vub.ac.be
Date: 29 Nov 2002 17:02:40 +0100
Local: Fri, Nov 29 2002 11:02 am
Subject: Re: remove-if and fill-pointer
"Paul F. Dietz" <di...@dls.net> writes:

> joac...@arti.vub.ac.be wrote:
> > Why is this?

> Because the standard requires it (Section 17.1)

ok, this is rather uncounterable :-)

but what about my second question? Maybe I should rephrase it:

"What are fill-pointer arrays for if you can only implement a stack
with them and not e.g. remove elements?"

Joachim.


 
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.
Paul F. Dietz  
View profile  
 More options Nov 29 2002, 11:05 am
Newsgroups: comp.lang.lisp
From: "Paul F. Dietz" <di...@dls.net>
Date: Fri, 29 Nov 2002 10:07:13 -0600
Local: Fri, Nov 29 2002 11:07 am
Subject: Re: remove-if and fill-pointer

I wrote:
>> I noticed that when using remove,remove-if etc. functions on an
>> adjustable array or an array with a fill-pointer, the result is an
>> array _without_ a fill-pointer and that is not adjustable.

>> Why is this?

> Because the standard requires it:

Atually, this isn't right.  It's possible that arrays with fill
pointers or adjustable arrays are also simple, but they typically aren't
in Lisps implemented on stock hardware.

        Paul


 
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 Nov 29 2002, 1:41 pm
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 29 Nov 2002 18:41:42 +0000
Local: Fri, Nov 29 2002 1:41 pm
Subject: Re: remove-if and fill-pointer
* joac...@arti.vub.ac.be
| I noticed that when using remove,remove-if etc. functions on an
| adjustable array or an array with a fill-pointer, the result is an array
| _without_ a fill-pointer and that is not adjustable.
|
| Why is this?

  Because you ask for a new sequence with the `removeŽ version.

  Perhaps you should investigate the `deleteŽ versions?

--
Erik Naggum, Oslo, Norway

Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.


 
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.
Tim Bradshaw  
View profile  
 More options Nov 29 2002, 2:35 pm
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@cley.com>
Date: 29 Nov 2002 18:39:07 +0000
Local: Fri, Nov 29 2002 1:39 pm
Subject: Re: remove-if and fill-pointer

* joachim  wrote:
> "What are fill-pointer arrays for if you can only implement a stack
> with them and not e.g. remove elements?"

Well, the classic answer would be some kind of buffer object.  Say I'm
reading chunks of data into a buffer, and I don't know how big they
are, but I know there's some maximum size (or maybe, if the size is
bigger than I've allowed for I'm willing to use ADJUST-ARRAY to
allocate a bigger buffer).  I want to reuse the buffer, but I don't
want to have to keep passing around the information that only the
first n elements of this thing actually have useful data.  So I use a
fill pointer to tell me that.

However, going back to your original question, I think you may be
confused about what REMOVE &co do - they are nondestructive functions,
so they aren't allowed to alter the arrays that are their arguments.
DELETE &co are allowed to be destructive, but don't have to be so.

--tim


 
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 »