Re: import functions from different .clj files

2014-07-12 Thread sorin cristea
I want to do something like when you import a file from a clojure package, for example the case of jdbc, you wrote* (:require [clojure.java.jdbc :as sql])* than you call functions from clojure jdbc with statement (sql/fc-name..) but seams that this not working in case you have two .clj files

import functions from different .clj files

2014-07-12 Thread sorin cristea
Hi all, I have file fileB.clj (ns a.b.c) (defn inc-sample [no] (+ no 1)) and file fileA.clj (ns a.b.c.d (:require [a.b.c.fileB :as fB])) (defn method-a [] (println "number incremented" (fB/inc-sample 2)) ) in fileA.clj I'm not able to see the functions from fileB.clj even

Re: macro - unquote

2014-06-20 Thread sorin cristea
http://blog.8thlight.com/colin-jones/2012/05/22/quoting-without-confusion.html On Thursday, June 19, 2014 12:22:36 PM UTC+3, sorin cristea wrote: > > > > hi all, > related to macro definition, what are the differences between*[** ' ]* > char and *[ ` ]* char ?

macro - unquote

2014-06-19 Thread sorin cristea
hi all, related to macro definition, what are the differences between*[** ' ]* char and *[ ` ]* char ? thanks. -- 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

Re: store a value in a PersistentVector and PersistentHashMap

2014-06-04 Thread sorin cristea
On Wednesday, June 4, 2014 4:32:00 PM UTC+3, François Rey wrote: > > On 04/06/14 14:59, sorin cristea wrote: > > do you know how is store a 'value' in a PersistentVector or in a > > PersistentHashMap ? > Hi Sorin, > Your question is difficult to understan

store a value in a PersistentVector and PersistentHashMap

2014-06-04 Thread sorin cristea
Hi all, do you know how is store a 'value' in a PersistentVector or in a PersistentHashMap ? Thanks Sorin. -- 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 me

Re: PersistentVector & PersistentHashMap - internal implementation

2014-06-03 Thread sorin cristea
On Tuesday, June 3, 2014 5:07:30 PM UTC+3, Stefan Kamphausen wrote: > > Hi, > > On Tuesday, June 3, 2014 4:02:45 PM UTC+2, sorin cristea wrote: >> >> Hi all, >> >>I don't know if this question was already asked by someone here but >> can

PersistentVector & PersistentHashMap - internal implementation

2014-06-03 Thread sorin cristea
Hi all, I don't know if this question was already asked by someone here but can you tell me(explain) or guide me to a properly documentation about how is internal implemented PersistenVector and PersistentHashMap , how they behave to an insert , remove, update; this question is came from p

PersisTVector & PersistHashMap - internal implementation.

2014-06-03 Thread sorin cristea
Hi all, I don't know if this question was already asked by someone here but can you tell me(explain) or guide me to a properly documentation about how is internal implemented PersistenVector and PersistentHashMap , how they behave to an insert , remove, update; this question is came from

Re: how to define a variable of type collection to keep other functions.

2014-05-28 Thread sorin cristea
u know why is more advantages to use *let *instead of *def *inside a *defn *? thanks Sorin On Saturday, May 24, 2014 2:04:55 AM UTC+3, Sean Corfield wrote: > > On May 23, 2014, at 2:19 AM, sorin cristea > > wrote: > > Thank Philippe for your advices,I came from java environ

Re: how to define a variable of type collection to keep other functions.

2014-05-23 Thread sorin cristea
ap, and reduce, these are the backbone functions when > programming in clojure. > > Also, do not use (def) inside a function, this is ugly. use let to define > local bindings instead. > > -- > Philippe. > > > > > On Fri, May 23, 2014 at 10:16 AM, sorin cristea >

how to define a variable of type collection to keep other functions.

2014-05-23 Thread sorin cristea
Hi all, do you have any idea how I can define a variable, global or inside a function, used to store for example the FutureTask objects resulted from ExecutorService submit(fn) call,I want to put all futures in a collection and later call 'get' on each of them. bellow is a sample of that code:

Re: how to add a function to a collection ?

2014-05-22 Thread sorin cristea
I see, this is the problem even if I call correct the function, sorry for that missing function parameter, when it will try to add the result of 'f1 "xxx" to 'collection' it will try to transform the result, fn..., to an type ISeq, this is what collection support, and there appear the prob

how to add a function to a collection ?

2014-05-22 Thread sorin cristea
Hi all, do you know how is possible to add a function result, that is another function, to a collection, a list for example: (defn *f1* [msg] (*fn[msg](println (str "hello " msg))*)) (def collection '()) (cons (f1) collection) in this situation f1 must be of type ISeq to can be added to

Re: Lazy sequence - how they work internally

2014-04-08 Thread sorin cristea
Hi Webb, What exactly you mean by '*The point was you aren't using lazy-seq as intended here since you are always creating a singleton sequence*' ? In my sum function: ( defn test-fc "sum of all collection elements using recursion and laziness" [coll] (letfn [(sum-fc [sum coll]

Re: Lazy sequence - how they work internally

2014-04-07 Thread sorin cristea
a result? > > Even if each iteration of the loop takes only 1 nanosecond, your function > would take 6 billion years to complete. > > - James > > > On 7 April 2014 21:01, sorin cristea >wrote: > >> >> Hi Gianluca, >> >> I have a question ; w

Re: Lazy sequence - how they work internally

2014-04-07 Thread sorin cristea
Hi Gianluca, I have a question ; why when a run/execute command/code line (test-fc (range 210432423543654675765876879)) it's not executed the function test-fc and return the sum for all 210432423543654675765876879 elements? why should I put the test-fc reference to a variable, x, like you pr

Re: Lazy sequence - how they work internally

2014-04-07 Thread sorin cristea
ically) converted to > iteration, with no stack overflow problems. > > hope this helps > Gianluca > > > > On Sunday, April 6, 2014 6:56:00 PM UTC+2, sorin cristea wrote: >> >> >> Hi, >> >> maybe this question was already put it here, but can s

Lazy sequence - how they work internally

2014-04-06 Thread sorin cristea
Hi, maybe this question was already put it here, but can someone explain how exactly work internal a function wrapped with lazy-seq keyword. For example in the below code sample: ( defn test-fc "sum of all collection elements using recursion and laziness" [coll] (letfn [(sum-fc [sum

Re: call clojure from java

2014-02-18 Thread sorin cristea
https://skillsmatter.com/skillscasts/3864-impromptu-rich-hickey-lightning-talk > > (you need to register to see the video) > > On Tuesday, 18 February 2014 11:39:20 UTC, sorin cristea wrote: >> >> Hi >> >> do you know how I can call a clojure script from a java me

call clojure from java

2014-02-18 Thread sorin cristea
Hi do you know how I can call a clojure script from a java method ? Thanks, Sorin. -- 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 - pleas