Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7953 > unrolled thread

Re: opposite of AppendTo

Started byFred Simons <f.h.simons@tue.nl>
First post2012-01-17 10:58 +0000
Last post2012-01-17 10:58 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: opposite of AppendTo Fred Simons <f.h.simons@tue.nl> - 2012-01-17 10:58 +0000

#7953 — Re: opposite of AppendTo

FromFred Simons <f.h.simons@tue.nl>
Date2012-01-17 10:58 +0000
SubjectRe: opposite of AppendTo
Message-ID<jf3k98$q73$1@smc.vnet.net>
Is this what you are looking for?

In[8]:= Attributes[mydelete]={HoldFirst};
mydelete[s_, e_] := s=DeleteCases[s,e]

In[10]:= s=Range[5];
mydelete[s,3];
s
Out[12]= {1,2,4,5}

Fred Simons
Eindhoven University of Technology

Op 16-1-2012 23:12, burke schreef:
> AppendTo[s,e] appends "e" to "s" and then RESETS "s". How does one
> delete or remove an element "e" from a list "s" and then RESET "s"?
> The _reset_ is my problem.  I want to be able to add and delete
> elements of a list (a list of graphical elements with very low
> opacity).  I can "appendto" the list at will but am unable to delete
> elements (using Delete, DeleteCases, Except, Select, etc.). Deleting
> "e" from "s" is easy enough, but resetting "s" seems impossible.
> Help!!
>
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web