Re: [ANN] rocks.clj/z 0.1.0-SNAPSHOT (alpha)

2018-01-03 Thread Edward Knyshov
Thanks :)

I haven't considered using nio Zip FileSystem just because I never heard of
it, but I'll definitely check it out.

Regarding targeting to java 7, should something like this set up targeting
properly?

:javac-options ["-target" "1.7" "-source" "1.7"]

Edward.

On Wed, Jan 3, 2018 at 8:29 PM Tim Visher  wrote:

> On Wed, Jan 3, 2018 at 6:56 AM, Edward Knyshov  wrote:
>
>> Hi, I made a simple wrapper around java.util.zip.
>> Basically it only allows you to compress files or unpack/process zip
>> archives.
>>
>
> This looks neat. :)
>
> Have you considered targeting Java 7 and using the nio Zip FileSystem?
> https://docs.oracle.com/javase/7/docs/technotes/guides/io/fsp/zipfilesystemprovider.html
>
> I ask mainly because I'm curious. I just started reading about it last
> night and this popped up this morning. What serendipity!
>
> --
>
> In Christ,
>
> Timmy V.
>
> http://blog.twonegatives.com
> http://five.sentenc.es
>
> --
> 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 a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/PFpL-fOaeQg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Best regards, Edward Knyshov.

-- 
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/d/optout.


Re: Is it wrong that I'm thinking about this?

2018-01-03 Thread Jeaye
I'll note, Orchestra added defn-spec in November and I forgot to mention it 
here.

Docs: https://github.com/jeaye/orchestra#defn-spec

On Wed, Jan 03, 2018 at 10:43:16PM +, Steven Collins wrote:
> This thread is a bit older, but since my team and I used prismatic/schema a 
> lot and found the specification next to the definition of a function helpful, 
> I published a library (https://github.com/lomin/sayang) that makes our 
> migration from prismatic/schema to clojure/spec easier. Maybe this is helpful 
> for you as well.
> 
> -- 
> 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/d/optout.

-- 
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/d/optout.


signature.asc
Description: PGP signature


Is it wrong that I'm thinking about this?

2018-01-03 Thread Steven Collins
This thread is a bit older, but since my team and I used prismatic/schema a lot 
and found the specification next to the definition of a function helpful, I 
published a library (https://github.com/lomin/sayang) that makes our migration 
from prismatic/schema to clojure/spec easier. Maybe this is helpful for you as 
well.

-- 
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/d/optout.


Re: [ANN] rocks.clj/z 0.1.0-SNAPSHOT (alpha)

2018-01-03 Thread Tim Visher
On Wed, Jan 3, 2018 at 6:56 AM, Edward Knyshov  wrote:

> Hi, I made a simple wrapper around java.util.zip.
> Basically it only allows you to compress files or unpack/process zip
> archives.
>

This looks neat. :)

Have you considered targeting Java 7 and using the nio Zip FileSystem?
https://docs.oracle.com/javase/7/docs/technotes/guides/io/fsp/
zipfilesystemprovider.html

I ask mainly because I'm curious. I just started reading about it last
night and this popped up this morning. What serendipity!

--

In Christ,

Timmy V.

http://blog.twonegatives.com
http://five.sentenc.es

-- 
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/d/optout.


[ANN] rocks.clj/z 0.1.0-SNAPSHOT (alpha)

2018-01-03 Thread Edward Knyshov
Hi, I made a simple wrapper around java.util.zip.
Basically it only allows you to compress files or unpack/process zip 
archives.
There is nothing special about it, but it simplifies code a lot when 
dealing with zip files.
It's an alpha release and I was just hoping that someone could take a look 
and point to some drawbacks/improvements in api/code.
It would be nice to fix those before pushing v0.1.0.
Link to the project https://github.com/edvorg/z
Cheers!

-- 
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/d/optout.


Re: [ANN] Clojure 1.9.0 is now available!

2018-01-03 Thread Luc
Thank you,

I was not searching strictly for a bug or regression, a malpractice was 
also something I wanted to ear about.
The let form generates this in both 1.8 & 1.9. No idea why the defrecord 
compiles in 1.8 but that could be related
to the way it is expanded in each version. I don't see the point of going 
down further on this path.

I will change the macro code here accordingly.

Luc P.


On Tuesday, 2 January 2018 22:22:18 UTC, Nicola Mometto wrote:
>
> The code that caused this issue is 
>
> https://github.com/clojure/clojure/commit/a1c3dafec01ab02fb10d91f98b9ffd3241e860c0?diff=unified#diff-03234b041c0917ec98f2ad9477a0a014R260
>  
> 
>  
> But this is not a bug in the clojure code nor a regression, in fact 
> you can reproduce this in any clojure version with the following code: 
>
> (defmacro m [] `[~@(keys )]) 
> (defprotocol p (f [_])) 
> (deftype t [^int x] p (f [_] (m))) 
>
>
> This is happening for the same reason why (let [x (int 1)] (identity 
> ^int x)) throws the same error, the fix in your case is to use (map 
> #(with-meta % {}) (keys )) 
>
> On Tue, Jan 2, 2018 at 11:03 PM, Luc  > wrote: 
> > Hi, 
> > 
> > finally got some time to dig deeper. The minimal code to reproduce this 
> has 
> > shrunk: 
> > 
> > (defprotocol Anonymous 
> >   (start-job! [this])) 
> > 
> > (defrecord NoopJob [] 
> >   Anonymous 
> >   (start-job! [this] 
> > (yabug.services.logger/environment))) 
> > 
> > The environment macro was called by log/error but not by the other 
> severity 
> > level macros. 
> > The error macro within a defrecord is the only case where it fails. 
> > 
> > This is the environment macro definition: 
> > 
> > (defmacro environment 
> >   "Expands to code that generates a map of locals: names to values" 
> >   [] 
> >   (clojure.pprint/pprint (macroexpand `(zipmap '~(keys ) [~@(keys 
> > )]))) 
> >   `(zipmap '~(keys ) [~@(keys )])) 
> > 
> > I added the macroexpand in the macro to get what it expands to in the 
> > context of the defrecord 
> > at compile time. 
> > Outside of the defrecord the compiler does not complain (let, ...)). The 
> > protocol by itself does not seem 
> > to be a significant factor. I got this at different places under 
> different 
> > protocols. 
> > 
> > This is the 1.9 macro expansion outputted at compile time before ending 
> up 
> > with exception while evaluating 
> > the resulting code: 
> > 
> > (clojure.core/zipmap 
> >  '(__hash __meta this __hasheq __extmap) 
> >  [__hash __meta this __hasheq __extmap]) 
> > 
> > This is the 1.8 macroexpansion of this macro which is a bit shorter, 
> there's 
> > seem to be less context generated by the defrecord macro 
> > expansion: 
> > 
> > (clojure.core/zipmap '(__meta this __extmap) [__meta this __extmap]) 
> > 
> > The expansion of the defrecord context is slightly bigger but nothing 
> hits 
> > me when I compare both expanded vectors at the end. 
> > I am assuming that this the expression that the compiler cannot evaluate 
> in 
> > 1.9 since it the error originates from the VectorExpr 
> > class. 
> > Is there anything obvious on with the evaluation of the last vector in 
> the 
> > 1.9 expansion that would explain this error ? 
> > I don't see it. 
> > 
> > Just to make things more puzzling the expansion literally works in the 
> 1.9 
> > REPL: 
> > 
> > => (defrecord NoopJob [] 
> >  impl/GatewayJob 
> >  (start-job! [this] 
> >(clojure.core/zipmap 
> >  '(__hash __meta this __hasheq __extmap) 
> >  [__hash __meta this __hasheq __extmap]))) 
> > yabug.jobs.noop.NoopJob 
> > 
> > Grr... 
> > 
> > Will sleep on it and toy with it tomorrow by expanding a bit the test 
> cases. 
> > It's nearly 22:00 Morocco time here. 
> > I need a break and some sleep. 
> > 
> > Luc P. 
> > 
> > On Saturday, 30 December 2017 01:00:05 UTC, Alex Miller wrote: 
> >> 
> >> On Fri, Dec 29, 2017 at 6:17 PM, Luc  wrote: 
> >> 
> >>> 
> >>> here it is, I did not get through the compiler source code yet, it 
> might 
> >>> be obvious to you: 
> >>> 
> >>> java.lang.UnsupportedOperationException: Can't type hint a primitive 
> >>> local, compiling:(yabug/jobs/noop.clj:21:9) 
> >>> Exception in thread "main" java.lang.UnsupportedOperationException: 
> Can't 
> >>> type hint a primitive local, compiling:(yabug/jobs/noop.clj:21:9) 
> >> 
> >> 
> >> What's the code here? ^^ 
> >> 
> >> 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@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 
> > 

Re: [ANN] Clojure 1.9.0 is now available!

2018-01-03 Thread Luc
Should have posted this instead, same protocol.

(defprotocol Anonymous (start-job! [this]))

;; Clojure 1.8.0
=> (defrecord NoopJob []
 Anonymous
 (start-job! [this]
   (yabug.services.logger/environment)))
(clojure.core/zipmap '(__meta this __extmap) [__meta this __extmap])
yabug.jobs.noop.NoopJob


On Tuesday, 2 January 2018 22:15:15 UTC, Alex Miller wrote:
>
> What’s GatewayJob look like?

-- 
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/d/optout.