Carlos
11/16/2015 1:25:00 PM
["WJ" <w_a_x_man@yahoo.com>, 2015-11-16 11:00]
> Wow. It failed to remove :b and 2, and it added nil
> at the end.
>
> To fail that miserably requires CL and one of its worshippers.
>
>
> MatzLisp (Ruby):
>
> def remove_key_and_val( plist, key)
> plist.slice_before{|x| x.is_a? Symbol}.reject{|k,v| k ==
> key}.flatten end
>
> remove_key_and_val([1,:a,1,:b,2,:c,3], :b)
> ==>[1, :a, 1, :c, 3]
def remove_key_and_val( plist, key)
plist.slice_before{|x| x.is_a? Symbol}.reject{|k,v| k == key}.flatten
end
=> :remove_key_and_val
remove_key_and_val([1, :first_symbol, :a, :second_symbol, :b, :third, :c], :b)
=> [1, :first_symbol, :a, :second_symbol, :third, :c]
OMG, total failure! That one only required WJ.
--