opposite of append/prepend

Jay's icon

Hello,

Is there any way to select a certain number/symbol on a list and delete it, sort of how prepend and append add to a list? I want to move letters from one list to another, as in:

[a b c d e] [w x y z]

becomes

[a b c d e x] [w y z]

when [x] is selected.

Adding to first list is easy, but removing from second list has me stumped.

Jay

Jeremy's icon

"zl filter" is your friend

jb

Emmanuel Jourdan's icon

On 21 juil. 08, at 18:09, Jay Bodley wrote:

> Hello,
>
> Is there any way to select a certain number/symbol on a list and
> delete it, sort of how prepend and append add to a list? I want to
> move letters from one list to another, as in:
>
> [a b c d e] [w x y z]
>
> becomes
>
> [a b c d e x] [w y z]
>
> when [x] is selected.
>
> Adding to first list is easy, but removing from second list has me
> stumped.

That's a job for [zl filter]:

Max Patch
Copy patch and select New From Clipboard in Max.

HTH,
ej

Jay's icon

is this new to max 5? i'm still running the ancient 4.6

Jeremy's icon

Here's an ugly hack to do it in 4.6. Someone probably has a better way.

Max Patch
Copy patch and select New From Clipboard in Max.

Wetterberg's icon

message box with:
$1 $3 $4

or:

unpack w x y z
into:
pack w y z

- I think both of these should work, but all these really complex
replies have got me spooked!

Jay Bodley skrev:
> Hello,
>
> Is there any way to select a certain number/symbol on a list and delete it, sort of how prepend and append add to a list? I want to move letters from one list to another, as in:
>
> [a b c d e] [w x y z]
>
> becomes
>
> [a b c d e x] [w y z]
>
> when [x] is selected.
>
> Adding to first list is easy, but removing from second list has me stumped.
>
> Jay
>
> .
>
>

Jay's icon

Thanks, Jeremy. With a little adjustment to fit my patch this is exactly what I needed.

Jeremy's icon

The problem with those solutions is that they assume a known population and ordering of the lists. 'zl filter' under Max 5, or something like the hack I posted are necessary to deal with unknown list length and content, and can better respond to changing needs (if you need to suddenly filter q instead of x).

jb

Quote: Wetterberg wrote on Mon, 21 July 2008 19:09
----------------------------------------------------
> message box with:
> $1 $3 $4
>
> or:
>
> unpack w x y z
> into:
> pack w y z
>
> - I think both of these should work, but all these really complex
> replies have got me spooked!

Wetterberg's icon

Jeremy Bernstein skrev:
> The problem with those solutions is that they assume a known population and ordering of the lists. 'zl filter' under Max 5, or something like the hack I posted are necessary to deal with unknown list length and content, and can better respond to changing needs (if you need to suddenly filter q instead of x).
Hey, I'm with you Jeremy, but sometimes you gotta K.I.S.S. - especially
if you DO know the length and content in advance, like when filtering
incoming data from a controller etc.
At any rate it's always nice to have both the big and omnipotent
solutions as well as the cutesie ones, at least in my mind.

Andreas

Jeremy's icon

This may not bring this discussion further, but it's amusing reading:

In Defense of Omnipotence: http://www.jstor.org/pss/2218842

Perhaps telling, "In Defense of Cutesiness" didn't come up with any hits.

jb

Brad Garton's icon

On Jul 21, 2008, at 4:45 PM, Andreas Wetterberg wrote:

> At any rate it's always nice to have both the big and omnipotent
> solutions as well as the cutesie ones, at least in my mind.

And if you really want to get carried away, [mxj maxlispj] is the
List-Processing Object For You.

Yeah, I'm one of those awful people who laugh at their own jokes (I
have to -- few others do...). I still get a kick out of the "bush-o-
matic" demo in the help patch. It's amazing how well the artificial-
stupidity engine still remains relevant. I just generated this one a
minute ago:

"I am destroying the military. I believe we should pursue drilling
in the Arctic National Wildlife Refuge. Mission
Accomplished!. American families unnerstand a balanced budget? Dick
Cheney's good friend Justice Scalia thinks we all hate a road map in
the mideast. The peoples of the Middle East want to defy nukular
weapons. Corporations want a manned mission to Mars by 2015.
America is safe again! Dead or alive. Smoke 'em out. 9/11. Bring
'em on. 9/11. Thank you -- and may God Bless America."

now *that's* list-processing.

Adam Murray's icon

Quote: Jeremy Bernstein wrote on Mon, 21 July 2008 13:55
----------------------------------------------------
> This may not bring this discussion further, but it's amusing reading:
>
> In Defense of Omnipotence: http://www.jstor.org/pss/2218842
>
> Perhaps telling, "In Defense of Cutesiness" didn't come up with any hits.
>

Don't question the cutesiness of a patch. Someone may sic Pikachu on you.

(sorry this is what happens when I need a break from work)

Wetterberg's icon

Jeremy Bernstein skrev:
> This may not bring this discussion further, but it's amusing reading:
>
> In Defense of Omnipotence: http://www.jstor.org/pss/2218842
>
> Perhaps telling, "In Defense of Cutesiness" didn't come up with any hits.
pfft, My God is so much cuter than Your God.

Jesse Terry from Ableton had a good name suggestion for Sampler, the
"big brother of Simpler"
- he wanted to call it "Complicator." I quite liked that name ;)

andreas