Two potential map-util functions

2010-03-08 Thread Luka
(= len 1) (dissoc m (first v)) true (update-in m (butlast v) #(dissoc % (last v)) Other thing I would like to ask is how can I see what is different in 40 github clones of clojure.contrib without clicking on every clone? Cheers, Luka -- You received this message because you are su

Re: Two potential map-util functions

2010-03-11 Thread Luka
Thanks everyone for answers! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from th

Something similar to (match) from scheme?

2010-03-11 Thread Luka
Is there a way to do pattern matching on values in clojure similar to this: http://docs.plt-scheme.org/reference/match.html What I'm trying to do is simple lexing/parsing: I would match parts of strings with regexp, and then do a parsing with match form. What is the best way of doing this in cl

Re: Something similar to (match) from scheme?

2010-03-13 Thread Luka
thanx, that's a start. It seems that plt-scheme's match is a bit more powerful, but I think I can manage with this as well. So far the biggest annoyance is the fact that I can match a number or a string, but not a symbol (I can in :when condition, I know...) which is something I can live with. --

Re: Something similar to (match) from scheme?

2010-03-13 Thread Luka
I just found clojure.contrib.types match which maybe fits more with what I'm trying to do... I'll check it out tomorrow, almost 3am here... -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com N

Re: Transpose and cast and max

2010-07-30 Thread Luka Stojanovic
On Fri, 30 Jul 2010 16:03:17 +0200, Base wrote: Hi All I have a vector in the following format: [ ["M" "3.4" "5.6"] ["L" "4.2" "6.6"] ["L" "4.9" "7.9"] ["L" "1.1" "2.4"]["L" "5.4" "4.5"] ] I would like to create a vector that contains the max values of each of the second and third values

Re: multiline strings and multiline comments ?

2010-08-16 Thread Luka Stojanovic
/* this is a multiline comment */ (comment This is a multiline comment?) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - p

Re: Exception when trying to require clojure.contrib.io

2010-08-16 Thread Luka Stojanovic
I have same problem: I'm using NetBeans 6.9.1/Enclojure, clojure-SNAPSHOT, running on Ubuntu 10.04 If I create Clojure project everything works OK. If I add Clojure scripts in existing Java project (and copy appropriate parts of pom.xml into that project) :require causes error as above, b

Re: Exception when trying to require clojure.contrib.io

2010-08-16 Thread Luka Stojanovic
Actually, it started working with require, and as far as I'm concerned, I've done nothing to fix the problem. On Mon, 16 Aug 2010 20:06:32 +0200, Luka Stojanovic wrote: I have same problem: I'm using NetBeans 6.9.1/Enclojure, clojure-SNAPSHOT, running on Ubuntu 10.0

Re: Simple Regex Question

2010-08-22 Thread Luka Stojanovic
On Sunday 22 August 2010 01:11:38 CuppoJava wrote: > Hi Everyone, > > I'm extremely stuck on this simple regex question, which I'm sure > someone with a little more experience will be able to write in a > second. I would really appreciate the help. > > Given a string consisting of a's, b's, and s

Re: trouble using nested map fn

2010-08-23 Thread Luka Stojanovic
On Mon, 23 Aug 2010 17:26:44 +0200, Glen Rubin wrote: I am trying to write a fn to correlate 2 signals using 3 nested map fn. I have 2 collections of data. THe first group of signals called target looks something like this. target: ( (1,2,3,4) (2,3,4,5) ...) The second collection is calle

Re: trouble using nested map fn

2010-08-23 Thread Luka Stojanovic
On Mon, 23 Aug 2010 18:01:13 +0200, Joop Kiefte wrote: bad example =/ Yes, it is but you get the gist I hope better example: #(first (sort %)) ;) (comp first sort) and #(some-fn x %) can be written as (partial some-fn x) which leaves #(some-fn % x) as case not trivial with other syntax

Re: misunderstanding collection

2010-08-25 Thread Luka Stojanovic
On Wed, 25 Aug 2010 16:06:15 +0200, Glen Rubin wrote: After toying around at the REPL I realize that I have been working with a heretofore invalid understanding of collections. For example, working with the following collection(s): signal: (((1 2 3 4) (2 3 4 5) (3 4 5 6)) ((3 4 5 6) (4 5 6 7)

Re: precise numbers

2010-10-12 Thread Luka Stojanovic
On Tue, 12 Oct 2010 20:53:16 +0200, cej38 wrote: On Oct 12, 12:50 pm, David Sletten wrote: This discussion may help:http://www.gettingclojure.com/cookbook:numbers#comparing-floats I originally tried something like float= described in the link, I give the definition here (defn float= ([x