The difference between not and complement is that not takes a *value* and
produces a new *value* which is true if the original was false (and vice
versa) while complement takes a *function* and produces a new *function *which
returns true in the cases where the original function would return
If I understand this right, you're looking for something like Lua's unpack
function. AFAIK you will not be able to do this in Clojure using functions,
because Clojure functions can only return one argument. The only way to
achieve this behavior would by by transforming your calls using reader
What about using destructuring?
(defn F [[a b c d]] (+ a b c d))
2012/11/6 the80srobot a...@ingenious.cz
If I understand this right, you're looking for something like Lua's unpack
function. AFAIK you will not be able to do this in Clojure using functions,
because Clojure functions can only
Seems like nifty shenanigans but how much does this course cover?
On Sunday, 28 October 2012 06:54:02 UTC-4, Ryan Kelker wrote:
There's a free 19 part series on basic Clojure @
http://www.udemy.com/clojure-code
--
You received this message because you are subscribed to the Google
Seems like nifty shenanigans but how much does this course cover?
It would be nice to see a course that covered some of the more advanced
features of the language,
like multimethods, concurrent programming, interop, etc.
On Sunday, 28 October 2012 06:54:02 UTC-4, Ryan Kelker wrote:
There's
After seeing this thread I looked into car and cdr, and there's one thing I
really liked about them: the various compositions.
There's quite a number of functions like caar, cadr, cadadr, etc. It's
lengthy to do that in clojure with just first and rest.
On Tuesday, 16 October 2012 18:40:24
On Tue, Nov 6, 2012 at 9:34 AM, JvJ kfjwhee...@gmail.com wrote:
There's quite a number of functions like caar, cadr, cadadr, etc. It's
lengthy to do that in clojure with just first and rest.
Clojure does have ffirst, fnext, nfirst, nnext tho' - and I'd question
why you'd need to string several
Is it possible to add an unquoted comma at the end of a Clojure sequence,
while using clojure.data.csv's write-csv?
(defn write-csv-file
Writes a csv file using a key and an s-o-s
[out-sos out-file]
(if (= dbg 1)
(println (first out-sos), \n, out-file))
(spit out-file :append
This is solved. I am adding a blank field, which gets me my trailing comma.
On Tuesday, November 6, 2012 2:40:19 PM UTC-5, octopusgrabbus wrote:
Is it possible to add an unquoted comma at the end of a Clojure sequence,
while using clojure.data.csv's write-csv?
(defn write-csv-file
Writes
I understand that, hence the example being to check if the value was a
function, since returning false from not'ing a function didn't make sense
to me. The change I was inquiring about applied to your example would be;
(filter (fnot even?) [1 2 3 4 5 6 7]) = (1 3 5 7)
(filter fnot [true false
On Nov 6, 2012, at 11:48 , Sean Corfield seancorfi...@gmail.com wrote:
On Tue, Nov 6, 2012 at 9:34 AM, JvJ kfjwhee...@gmail.com wrote:
There's quite a number of functions like caar, cadr, cadadr, etc. It's
lengthy to do that in clojure with just first and rest.
Clojure does have ffirst,
In Javascript you seem to be able to set the context for this to any
fn-object by specifying your desired context's this in the call/apply call.
(never knew about this option - feels like an aweful hack to define
invocation-scope but some libraries use it… see
You could do: (.call f context ...)
On Tue, Nov 6, 2012 at 5:33 PM, Frank Siebenlist frank.siebenl...@gmail.com
wrote:
In Javascript you seem to be able to set the context for this to any
fn-object by specifying your desired context's this in the call/apply
call.
(never knew about this
Too easy ;-)
Thanks, FrankS.
On Nov 6, 2012, at 2:38 PM, David Nolen dnolen.li...@gmail.com wrote:
You could do: (.call f context ...)
On Tue, Nov 6, 2012 at 5:33 PM, Frank Siebenlist frank.siebenl...@gmail.com
wrote:
In Javascript you seem to be able to set the context for this
I'd say the simplest answer is just that functions *are* values, they are
never logical-false, and (not) is based on logical falseness. Giving (not)
a special case for functions would make it less composable by trying to
make it do more.
-James
On Tuesday, 6 November 2012 14:55:53 UTC-5,
Is there any way to write an anonymous macro in Clojure?
This post:
http://stackoverflow.com/questions/4074961/anonymous-macros-in-clojure
says it's possible with some hacks and in version 1.3 Clojure will have
some kind of support for this.
Thank you for your time.
-Sean
--
You received this
I'm afraid not. Macro should be bound on a var. The clojure compile
checks an attribute (isMacro) on a var to determine if it's a macro or
function.
And Since a macro has no value, you cannot write it with some literals.
On Wed 07 Nov 2012 08:16:42 AM CST, Sean Neilan wrote:
Is there any way
May I know in what circumstances would an anonymous macro be applied? - I
just don't think there's a way to define anonymous macro but maybe we can
make a workaround by manipulating the macro syntax...
在 2012年11月7日星期三UTC+8上午8时17分37秒,Sean Neilan写道:
Is there any way to write an anonymous macro
I was hoping to write a macro inside of a let statement. The macro would be
returned from the let and keep closures to whatever was defined in the let.
Also, if possible, define multiple global macros inside of a let statement
so it's as if the let is returning multiple values.
On Tue, Nov 6,
I was hoping to write a macro inside of a let statement. The macro would be
returned from the let and keep closures to whatever was defined in the let.
Also, if possible, define multiple global macros inside of a let statement
so it's as if the let is returning multiple values.
On Tue, Nov 6,
Well, logically the difference between a function and macro is just that
the parameters will be evaluated in a function call but will not in a macro
call. I suppose you can use anonymous function to achieve what you may want
in a LET statement.
And as SunNing said, Clojure will use meta tag
Take a look at tools.macro/macrolet.
https://github.com/clojure/tools.macro/
Regards,
BG
Sent from phone. Please excuse brevity.
On 6 Nov 2012 19:10, Sean Neilan s...@seanneilan.com wrote:
I was hoping to write a macro inside of a let statement. The macro would
be returned from the let and
Yep. `macro-let` is what you're looking for.
On Tue, Nov 6, 2012 at 10:41 PM, Baishampayan Ghose b.gh...@gmail.comwrote:
Take a look at tools.macro/macrolet.
https://github.com/clojure/tools.macro/
Regards,
BG
Sent from phone. Please excuse brevity.
On 6 Nov 2012 19:10, Sean Neilan
23 matches
Mail list logo