Groups
Groups
Sign in
Groups
Groups
Clojure
Conversations
About
Send feedback
Help
Is there a standard function testing if a sequence starts with a sequence
1 view
Skip to first unread message
samppi
unread,
Jul 17, 2009, 4:32:01 PM
7/17/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Clojure
Is there a function in clojure.core or clojure.contrib so that:
(and (mystery-fn '(a b c d) '(a b))
(not (mystery-fn '(a b c d) '(a b d))))
Mark Engelberg
unread,
Jul 17, 2009, 4:41:34 PM
7/17/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to clo...@googlegroups.com
how about something like:
(defn mystery-fn [l1 l2] (every? identity (map = l1 l2)))
samppi
unread,
Jul 17, 2009, 4:51:23 PM
7/17/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Clojure
Awesome, thanks for the quick answer. I think that it'd be a useful
thing to add to seq-utils or something. :)
On Jul 17, 1:41 pm, Mark Engelberg <
mark.engelb...@gmail.com
> wrote:
John Harrop
unread,
Jul 17, 2009, 6:02:29 PM
7/17/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to clo...@googlegroups.com
user=> (mystery-fn '(a b) '(a b c d))
true
How about something like:
(defn mystery-fn [l1 l2] (and (<= (count l2) (count l1)) (every? identity (map = l1 l2))))
Reply all
Reply to author
Forward
0 new messages