I think it's a bug.
From ub3 "member(x, ...) returns x if its second and subsequent arguments are
all members of set,
cset, list or table x but fails otherwise. If x is a cset, all of the
characters in subsequent
string arguments must be present in x in order to succeed."
Of course he could always do something like this ....
procedure member(X[])
static builtin
initial builtin := proc("member",0)
if *X > 1 then
if type(X[1]) ~== "list" then return builtin!X
else {
every x := X[2 to *X] do
if x === !X[1] then next else fail
return X[1]
}
end
in the short term.
David
>________________________________
>From: Steve Wampler <[email protected]>
>To: [email protected]
>Sent: Tuesday, September 27, 2011 9:16:33 AM
>Subject: Re: [Unicon-group] [unicon-group] member
>
>On Tue, Sep 27, 2011 at 01:59:01PM +0100, John Sampson wrote:
>> For beginners it might be useful in a future version if an attempt to use
>> 'member' with a list as first argument gave an error message. It is not
>> obvious from the term that it applies to sets and tables but not lists.
>> If one uses it with a list it just mysteriously fails.
>
>John has a good point and raises an interesting question:
>
>Why shouldn't member(["a","b","c"], "c") work? Yes, it would
>be slower than testing membership in a set or table, but...
>
>
>
>------------------------------------------------------------------------------
>All the data continuously generated in your IT infrastructure contains a
>definitive record of customers, application performance, security
>threats, fraudulent activity and more. Splunk takes this data and makes
>sense of it. Business sense. IT sense. Common sense.
>http://p.sf.net/sfu/splunk-d2dcopy1
>_______________________________________________
>Unicon-group mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/unicon-group
>
>
>------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group