Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-07 Thread Valentin Golev
Graph definitions really remind me of `do` syntax in Haskell, where you can 
bind values and then use them in later steps of the computation.

On Tuesday, January 29, 2013 10:46:54 PM UTC+4, Aria Haghighi wrote:
>
> Hey all,
>
>  Prismatic has open-sourced our Plumbing and Graph library on 
> github. 
> Jason Wolfe gave a 
> talkabout
>  how we use graph for systems composition at Strange loop last year. 
> Please give the library
> a whirl and let us know if you're using it and if you find any issues or 
> feature requests. We use this library very heavily throughout our code and 
> hope others find it useful as well.
>
>  Best, Aria
>

-- 
-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Inflection on clojure.java.io/reader and writer

2013-02-06 Thread Valentin Golev

> Welcome to a world of values, not containers (the blue pieces can only 
fit in the blue 
> container, the red ones  you get the picture) or as Rich says places. 

I always thought that by places he means mutable identifiers; languages 
like Haskell have a lot of luck with type-checking immutable *values*. I 
don't see how appreciation for values over places leads to lack of 
type-checking.

On Wednesday, February 6, 2013 4:50:54 AM UTC+4, Luc wrote:
>
> You are not defining a type here. A type hint is just that... a hint so 
> the compiler 
> can optimize the code it generates to call the readLine method on this 
> specific 
> object class. 
>
> As an example, if io/reader returned an object of a different class at 
> runtime 
> than BufferedReader, it would not fail even if the hint says "expect an 
> object of this class". 
>
> The generated code testing that the object is not of the hinted class 
> would 
> resort to reflection on the object class to find if the readLine method 
> exists. 
> If not you will get the usual runtime error saying that the method does 
> not exists. 
>
> The Clojure compiler has no type checking equivalent to Java, C, ... 
> You can define stuff that is not even bound to a value, it would be hard 
> to type check on 
> these at compile time, no ? 
>
> Welcome to a world of values, not containers (the blue pieces can only fit 
> in the blue 
> container, the red ones  you get the picture) or as Rich says places. 
>
> Luc P. 
>
>
> > That's funny, I did exactly the same thing and wrote BufferedReader for 
> > both. DOH! 
> > 
> > Although I have no idea how the internals of type hinting is, I do think 
> > it's peculiar that there doesn't seem to be type error checking, even 
> > though we are explicitly "defining" the type. I would feel like it 
> should 
> > error, instead of falling back on reflection. 
> > 
> > Kanwei 
> > 
> > On Monday, February 4, 2013 12:36:51 PM UTC-5, AtKaaZ wrote: 
> > > 
> > > in other words: 
> > > this: 
> > > 
> > >   (let [in (clojure.java.io/reader src) 
> > > out (clojure.java.io/writer dest) 
> > > 
> > > 
> > > becomes this: 
> > > (let [^java.io.BufferedReader in (clojure.java.io/reader src) 
> > >^java.io.BufferedWriter out (clojure.java.io/writer dest) 
> > > 
> > > 
> > > and it works for me too. (but I wasted some time by having 
> BufferedReader 
> > > in both places) 
> > > 
> > > 
> > > On Mon, Feb 4, 2013 at 6:26 PM, Andy Fingerhut 
> > >  
>
> > > > wrote: 
> > > 
> > >> I don't have CCW Eclipse installed to test, but by saving that file 
> on my 
> > >> Mac (should also work on Linux) in a subdirectory "obj", and editing 
> it to 
> > >> add the ^java.io.BufferedReader in and ^java.io.BufferedWriter out 
> type 
> > >> hints as suggested by Luc P. earlier in this thread, I was able to 
> > >> eliminate the reflection warnings: 
> > >> 
> > >> % mkdir obj 
> > >> % cp  obj/solutions.clj 
> > >> 
> > >> # Original file without the type hints gives reflection warnings as 
> > >> expected 
> > >> 
> > >> % java -Dclojure.compile.path=./obj -cp clojure-1.4.0.jar:./obj 
> > >> clojure.lang.Compile solution 
> > >> Compiling solution to ./obj 
> > >> Reflection warning, solution.clj:38 - reference to field readLine 
> can't 
> > >> be resolved. 
> > >> Reflection warning, solution.clj:45 - reference to field readLine 
> can't 
> > >> be resolved. 
> > >> Reflection warning, solution.clj:63 - reference to field newLine 
> can't be 
> > >> resolved. 
> > >> Reflection warning, solution.clj:54 - reference to field newLine 
> can't be 
> > >> resolved. 
> > >> 
> > >> # Now I hand-edit obj/solutions.clj to add the type hints, and 
> recompile. 
> > >>  No reflection warnings. 
> > >> % java -Dclojure.compile.path=./obj -cp clojure-1.4.0.jar:./obj 
> > >> clojure.lang.Compile solution 
> > >> Compiling solution to ./obj 
> > >> % 
> > >> 
> > >> Perhaps you should try verifying that you added the type hints 
> correctly, 
> > >> saved the source file, recompiled the one you wanted to in CCW 
> Eclipse, etc. 
> > >> 
> > >> Andy 
> > >> 
> > >> 
> > >> On Feb 4, 2013, at 9:10 AM, Kanwei Li wrote: 
> > >> 
> > >> Hey Andy, 
> > >> 
> > >> Thanks for offering to help. Here's a gist: 
> > >> https://gist.github.com/4696105 
> > >> 
> > >> As you can see at the bottom, I want the main method to read/write to 
> > >> STDIN/STDOUT, but for testing, I want to read from files instead. 
> > >> 
> > >> This is what I get in both CCW Eclipse and nrepl: 
> > >> 
> > >> Reflection warning, NO_SOURCE_PATH:4 - reference to field readLine 
> can't 
> > >> be resolved. 
> > >> 
> > >> Reflection warning, NO_SOURCE_PATH:11 - reference to field readLine 
> can't 
> > >> be resolved. 
> > >> 
> > >> Reflection warning, NO_SOURCE_PATH:29 - reference to field newLine 
> can't 
> > >> be resolved. 
> > >> 
> > >> Reflection warning, NO_SOURCE_PATH:20 - reference to field newLine 
> can't 
> > >> be resolved. 
> > >> Thanks! 
> > >> 
> > >>