Re: binary structures/bitstrings

2010-04-18 Thread Geoff
I've implemented something similar for working with
java.nio.ByteBuffer objects to pull apart and build network packets,
but it's not packaged as a separate library right now. Look at
http://github.com/geoffsalmon/bonjure/blob/master/src/bonjure/bytebuffer.clj
specifically the pack, unpack, pack-bits, unpack-bits functions. Does
that do what you need? There's examples in the tests
http://github.com/geoffsalmon/bonjure/blob/master/test/bonjure/bytebuffer_test.clj
I've only used it for one particular task, but I'd like to separate it
and push it to clojars. It's about time I learn how to do that.

- Geoff

On Apr 16, 9:28 pm, Scott T  wrote:
> Does anyone know of a clojure library for handling (un)packing of
> binary structures?  I'm looking for something similar to perl/ruby/
> python's pack(...) function or something like OCaml's bitstring
> module.  My initial google and clojure-contrib perusing hasn't turned
> up anything obvious though I've found at least one interesting blog
> post on a related subject.
>
> If there is such a thing in existence I'd like to know about it
> otherwise I'll probably want to create it - to scratch my own itch -
> and maybe someone else will have an interest in such a thing.
>
> -stt
>
> --
> 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 
> athttp://groups.google.com/group/clojure?hl=en

-- 
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


Re: binary structures/bitstrings

2010-04-19 Thread Geoff
I've pushed the bytebuffer stuff into it's own repo and project and
cleaned up the documentation a bit.
See http://github.com/geoffsalmon/bytebuffer

I'd appreciate any feedback you have after trying it out.

- Geoff

-- 
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


Re: Running Clojure scripts in Maven

2010-05-19 Thread Geoff
This is cool. What I'd really like to do though is run some of the
clojure code belonging to the project during the build. I'm toying
with a webapp that runs on google appengine and I'd like to "bake"
some pages to produce static html/css/js files at build time using the
same templates and everything that the dynamic parts of the webapp
will use once it's deployed.

It looks like your clojure-maven-plugin is using the classloader of
the plugin class when running the clojure. Could it also add the
clojure source directories in there some how? Maybe using a new
URLClassLoader with the plugin classloader as the parent. This might
only work if it's running after the compile phase. Not sure of the
maven classloader intricacies here.

- Geoff

On May 16, 11:26 am, Jason Smith  wrote:
> On May 16, 7:22 am, "Hugo Duncan" 
> wrote:
>
> >> ...
>
> > In case you are interested, I recently implemented some of the  
> > infrastructure to allow you to writemavenplugins in clojure. A simple  
> > example that just logs basedir is here:
>
> >http://github.com/hugoduncan/clojure-mojo-example/blob/master/src/mai...
>
> > The annotation support isn't complete yet, but the simple example works.
>
> > --
> > Hugo Duncan
>
> On a related note, I was wondering if anyone had taken a stab at
> Clojure stub generation.  That is, on the "generate-sources" phase,
> you generate .java files that stub out the classes you mean to create
> in Clojure.  Javac comes along, sees the stubs, and can compile all
> the classes together.
>
> Then, once Javac has done its work, you run Clojure to replace the
> stubbed .class files with the real thing.  Solves the "chicken-and-
> egg" problem quite nicely.
>
> The stubs would contain Javadoc, annotations, and generics
> (eventually...), allowing Java frameworks to easily consume classes
> compiled from Clojure.  That is, it would work with the compile-time
> annotation processor from Java 5 and 6, and it would also work 
> withMavenplugins, since they use Javadoc (inMaven2, at least) for
> annotations.  I had imagined thatMavenplugins would just sort of
> fall out from having a good stub generator.
>
> Has anyone talked about doing something like this???
>
> This is how the Groovy cross-compiler works, and how GMaven (the
> GroovyMavenplugin) performs cross compilation.  Of course, it should
> be much easier to do with Clojure.  With Groovy you have to worry
> about all the intricacies of  ANTLR, but parsing in Clojure is dead
> simple.  Theoretically you should just have to look for the correct
> function names and metadata and spit out Java source.
>
> --
> 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 
> athttp://groups.google.com/group/clojure?hl=en

-- 
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


Re: Running Clojure scripts in Maven

2010-05-20 Thread Geoff
How about two separate maven goals? One "script" goal that does the
current behaviour and shares vars, and one "execute" goal that can run
code from the project.
I imagine the "execute" goal would usually be used to call a single
function in the clj source files. To simply support this, the goal
could optionally take an "entryFn" instead of "source". The entryFn
would be something like "my.ns/main-func" and would name a no-argument
function to be called.

- Geoff

On May 19, 11:44 pm, Jason Smith  wrote:
> Okay, yes, what you are asking is possible, and I know how to do it.
> Of course, to see the compiled artifacts on the classpath, you'll have
> to be running in a state that runs after they have been created.  :-)
>
> This shouldn't be terribly hard to do, but it's a bit arcane.  I'll
> see if I can make it happen in the next couple of days.  In the
> meantime, I need a parameter name!  Any suggestions?
>
> Mode 1:
> * Original plugin classloading.  All scripts share the same set of
> variables (defs), as if all run from a single REPL, but they don't
> share the project artifact or any project dependencies.  This mode
> runs fastest since Clojure only has to be inited once.
> * "Isolated" classloading.  The scripts are isolated from one another,
> but share artifacts with the project.  Thus not isolated at all.  So
> what do I call it??? Clojure has to be inited for each execution, so
> this will be a bit slower.
>
> The other option is that I only make the second form of classloading
> available, but I also kind of like the ability to share state between
> scripts... which you would lose if I did that...
>
> --
> 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 
> athttp://groups.google.com/group/clojure?hl=en

-- 
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


Re: ANN: Gloss, a byte-format DSL

2011-01-06 Thread Geoff
Hey Eric
I did something similar for handling unsigned types. I think it's
simpler and probably faster, not that I've checked. Here's a gist of
it https://gist.github.com/767887

That code is part of a little library I wrote a while ago
https://github.com/geoffsalmon/bytebuffer  It's closer to your bin-ed
in complexity than to gloss. You might also find the pack-bits and
unpack-bits functions useful if you're parsing bit-fields and not
using Gloss's bits-seq.

I'm going to give Gloss a try. For complex binary structures, I think
I like it's way of specifying formats using (keyword, type) pairs and
reading and writing maps instead of bytebuffer's which specifies
formats as strings ('b' for byte, 'i' for int, and so on) and reads
and writes seqs of values.

- Geoff


On Jan 5, 5:45 pm, "Eric Schulte"  wrote:
> also, here's a patch to Gloss which I've used locally but which may be
> generally useful.
>
> Cheers -- Eric
>
>  0001-adding-primitive-support-for-uint16-uint32-and-uint6.patch
> 1KViewDownload
>
>
>
> "Eric Schulte"  writes:
> > Thanks for sharing this library, I found reading your code to be very
> > useful.
>
> > I need to be able to read and write elf files from within Clojure code,
> > and Gloss initially looked like a good option.  However much of the
> > streaming support and frame-based conception got in the way of my
> > particular needs.
>
> > In the end I have written a much simpler collection of functions which
> > supports parsing binary files into lists of bytes, manipulating these
> > lists, and then writing the lists back to binary files.  This is heavily
> > influenced by the code in Gloss.  Seehttps://github.com/eschulte/bin-ed
>
> > Anyways just thought I'd share, if anyone notices anything in the code
> > which doesn't make sense, or could be more easily accomplished in some
> > other way please do let me know.
>
> > Thanks -- Eric

-- 
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


Java interoperability and Clojure

2009-04-02 Thread Geoff Wozniak

What are the limitations of Clojure and Java interoperability? Are
they clearly stated somewhere?

I have been experimenting with using Clojure to test some existing
Java code (being able to do so makes a convincing argument to use it
where I work) and I've noticed that there doesn't seem to be any way
to call or access package-protected methods or fields -- either that
or I'm doing something wrong. :)

I've also been trying use the java.lang.reflect capabilities (such as
setAccessible() in java.lang.reflect.AccessbileObject) and noticed
that they do not have an effect. How much can be done using those
libraries within Clojure to affect Java code?

Any information provided would be most helpful.  Being able to use
Clojure to write tests for existing Java code (that extensively
employs package-protected methods and fields) would be a nice way to
demonstrate Clojure's capabilities to some people I work with.

--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: Java interoperability and Clojure

2009-04-03 Thread Geoff Wozniak

Thanks for the links, Stuart, although I managed to figure out what I
was doing wrong: I didn't realize that the Java vararg type Object...
mapped to a sequence in Clojure, so I wasn't properly calling 'invoke'
in java.lang.reflect.Method.

Again, thanks for the links. I'm sure they'll be helpful in the
future.

On Apr 2, 11:26 pm, Stuart Halloway  wrote:
> Hi Geoff,
>
> You should have no trouble using setAccessible.  There are several  
> demos of this in the source code for the book [1] that use  
> setAccessible to check private fields in a unit test. (See lancet/test/
> step-2-complete.clj [2], for instance).
>
> Hope this helps,
> Stu
>
> [1]http://github.com/stuarthalloway/programming-clojure/tree/master
> [2]http://github.com/stuarthalloway/programming-clojure/blob/401f348b53d...
>
>
>
>
>
> > What are the limitations of Clojure and Java interoperability? Are
> > they clearly stated somewhere?
>
> > I have been experimenting with using Clojure to test some existing
> > Java code (being able to do so makes a convincing argument to use it
> > where I work) and I've noticed that there doesn't seem to be any way
> > to call or access package-protected methods or fields -- either that
> > or I'm doing something wrong. :)
>
> > I've also been trying use the java.lang.reflect capabilities (such as
> > setAccessible() in java.lang.reflect.AccessbileObject) and noticed
> > that they do not have an effect. How much can be done using those
> > libraries within Clojure to affect Java code?
>
> > Any information provided would be most helpful.  Being able to use
> > Clojure to write tests for existing Java code (that extensively
> > employs package-protected methods and fields) would be a nice way to
> > demonstrate Clojure's capabilities to some people I work with.
--~--~-~--~~~---~--~~
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
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
-~--~~~~--~~--~--~---



Re: [ANN] Baum - Extensible EDSL in EDN for configuration files

2015-04-10 Thread Geoff Salmon
Hi Ryo

Thanks for releasing this. I've started using it for a configuration file 
that was previously an edn file. I was mainly interested in the import and 
include features but have now started using the eval macro to replace some 
repetitive parts of the file with for loops. I'll admit that using eval and 
embedding clojure in the config file feels like a slippery slope. I'm 
worried I'll quickly make understanding clojure a prerequisite for editing 
the config file. I'm not sure if the answer is to add a few more macros for 
common things like looping, or if I just need to be diligent and use eval 
sparingly or not at all. It seems easy to remove features in baum to 
enforce keeping the file simple, but I haven't taken that step yet.

The import/include feature alone is useful though. I did hit two problems 
with my use-case though.

First, I wanted relative include paths to be resolved relative to the path 
of the file being parsed. I hacked around this in a messy way, but do you 
think it would make sense to either add a :relative-to-path or a 
:file-resolve-fn to opts to customize how relative paths are resolved? The 
:file-resolve-fn value would be a function called with the opts and the 
included file's path and returns the absolute path or any object slurp 
accepts. I haven't thought through how nested relative includes would work.

Second, I wanted to customize how the contents of the included map was 
merged. For example, when both maps contained a key whose values are 
vectors I wanted to concatenate the vectors. I implemented this as my own 
reducer, but the other way would be to add a key to opts for controlling 
the merge behaviour of include/import/override. I don't know if this is a 
common enough requirement to warrant that though.

thanks again!
Geoff

On Saturday, 4 April 2015 05:59:27 UTC-4, Ryo Fukumuro wrote:
>
> Hi all,
>
> I'd like to announce the release of Baum.
>
> https://github.com/rkworks/baum
>
> Baum, my first public library for Clojure, is designed to create
> "self-contained" configuration files.
>
> It allows you to include the following things in your configuration files:
>
>  - References to external files
>  - References to environment variables with a fallback value
>  - Conditional loading of a part of config tree
>  - `let`
>  - etc
>
> And it is very easy to extend the DSL to add new features.
> For more details, please see README.
>
> Any suggestions are welcome.
>
> Best,
> Ryo
>

-- 
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.7.0-RC1 now available

2015-05-29 Thread Geoff Shannon
I just tried to upgrade a clj/cljs webapp I wrote. I got an error but it 
was just a transitive dependency issue with instaparse 
https://github.com/Engelberg/instaparse/issues/90.

Everything works great now that I'm using up-to-date dependencies!
 
On Thursday, May 21, 2015 at 11:31:16 AM UTC-5, Alex Miller wrote:
>
> Clojure 1.7.0-RC1 is now available.
>
> Try it via
> - Download: https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-RC1/
> - Leiningen: [org.clojure/clojure "1.7.0-RC1"]
>
> The only change since 1.7.0-beta3 is CLJ-1706, which makes reader 
> conditional splicing an error at the top level (previously it would 
> silently drop all but the first spliced element).
>
> For a full list of changes since 1.6.0, see:
> https://github.com/clojure/clojure/blob/master/changes.md
>
> Please give it a try and let us know if things are working (or not). The 
> more and quicker feedback we get, the sooner we can release 1.7.0 final!
>
> - Alex
>

-- 
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.


"proxy"ing PersistentHash to allow key->val and (reverse key)->val mapping

2014-07-25 Thread Geoff Little
I'm attempting to proxy PersistentHashmap so that "get"ting an existing key 
or its reverse returns the same value.

Here's the code that I have

(defn sym-key-hash-map []
  (proxy [clojure.lang.PersistentHashMap] [nil 0 nil false nil]
(valAt [key]
   (or (proxy-super valAt key)
   (proxy-super valAt (reverse key))

(let [key (list 1 2)]
  (get (assoc (sym-key-hash-map) key "sweet")
   (reverse key)))

But unfortunately, the test code returns nil instead of "sweet".

Does anyone with knowledge of proxy and PersistentHashmap know how to solve 
this?

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 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: "proxy"ing PersistentHash to allow key->val and (reverse key)->val mapping

2014-07-25 Thread Geoff Little
bump!

On Thursday, July 24, 2014 9:52:48 PM UTC-4, Geoff Little wrote:
>
> I'm attempting to proxy PersistentHashmap so that "get"ting an existing 
> key or its reverse returns the same value.
>
> Here's the code that I have
>
> (defn sym-key-hash-map []
>   (proxy [clojure.lang.PersistentHashMap] [nil 0 nil false nil]
> (valAt [key]
>(or (proxy-super valAt key)
>(proxy-super valAt (reverse key))
>
> (let [key (list 1 2)]
>   (get (assoc (sym-key-hash-map) key "sweet")
>(reverse key)))
>
> But unfortunately, the test code returns nil instead of "sweet".
>
> Does anyone with knowledge of proxy and PersistentHashmap know how to 
> solve this?
>
> 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 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: "proxy"ing PersistentHash to allow key->val and (reverse key)->val mapping

2014-07-25 Thread Geoff Little
Thanks so much Ambrose!  I know that function is simple, but I don't 
understand how it provides the functionality I'm after.  Do you mind 
explaining what's going on?  I'm playing with it now in my repl.

Thanks!!

On Friday, July 25, 2014 6:48:06 PM UTC-4, Ambrose Bonnaire-Sergeant wrote:
>
> Hi Geoff,
>
> You probably want a sorted-map-by:
>
> user=> (sorted-map-by (fn [a b] (or (when (every? coll? [a b]) (when (= a 
> (reverse b)) 0)) -1)) [1 2] 42 [2 1] 42)
> {[1 2] 42}
>
> Thanks,
> Ambrose
>
>
> On Fri, Jul 25, 2014 at 9:52 AM, Geoff Little  > wrote:
>
>> I'm attempting to proxy PersistentHashmap so that "get"ting an existing 
>> key or its reverse returns the same value.
>>
>> Here's the code that I have
>>
>> (defn sym-key-hash-map []
>>   (proxy [clojure.lang.PersistentHashMap] [nil 0 nil false nil]
>> (valAt [key]
>>(or (proxy-super valAt key)
>>(proxy-super valAt (reverse key))
>>
>> (let [key (list 1 2)]
>>   (get (assoc (sym-key-hash-map) key "sweet")
>>(reverse key)))
>>
>> But unfortunately, the test code returns nil instead of "sweet".
>>
>> Does anyone with knowledge of proxy and PersistentHashmap know how to 
>> solve this?
>>
>> Thanks.
>>
>> -- 
>> 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
>> clojure+u...@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+u...@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.


Re: "proxy"ing PersistentHash to allow key->val and (reverse key)->val mapping

2014-07-25 Thread Geoff Little
Is this comparator called when get is called?  How does this allow calling 
get on the reverse of a valid key?

Geoff

On Friday, July 25, 2014 7:58:47 PM UTC-4, Ambrose Bonnaire-Sergeant wrote:
>
> The function basically returns 0 if the keys are equivalent, or -1 
> otherwise.
>
> It satisfies a comparator, see 
> http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html#compare(T,%20T)
>
> Thanks,
> Ambrose
>
>
> On Sat, Jul 26, 2014 at 7:52 AM, Geoff Little  > wrote:
>
>> Thanks so much Ambrose!  I know that function is simple, but I don't 
>> understand how it provides the functionality I'm after.  Do you mind 
>> explaining what's going on?  I'm playing with it now in my repl.
>>
>> Thanks!!
>>
>>
>> On Friday, July 25, 2014 6:48:06 PM UTC-4, Ambrose Bonnaire-Sergeant 
>> wrote:
>>
>>> Hi Geoff,
>>>
>>> You probably want a sorted-map-by:
>>>
>>> user=> (sorted-map-by (fn [a b] (or (when (every? coll? [a b]) (when (= 
>>> a (reverse b)) 0)) -1)) [1 2] 42 [2 1] 42)
>>> {[1 2] 42}
>>>
>>> Thanks,
>>> Ambrose
>>>
>>>
>>> On Fri, Jul 25, 2014 at 9:52 AM, Geoff Little  wrote:
>>>
>>>> I'm attempting to proxy PersistentHashmap so that "get"ting an existing 
>>>> key or its reverse returns the same value.
>>>>
>>>> Here's the code that I have
>>>>
>>>> (defn sym-key-hash-map []
>>>>   (proxy [clojure.lang.PersistentHashMap] [nil 0 nil false nil]
>>>> (valAt [key]
>>>>(or (proxy-super valAt key)
>>>>(proxy-super valAt (reverse key))
>>>>
>>>> (let [key (list 1 2)]
>>>>   (get (assoc (sym-key-hash-map) key "sweet")
>>>>(reverse key)))
>>>>
>>>> But unfortunately, the test code returns nil instead of "sweet".
>>>>
>>>> Does anyone with knowledge of proxy and PersistentHashmap know how to 
>>>> solve this?
>>>>
>>>> Thanks.
>>>>
>>>> -- 
>>>> 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
>>>> clojure+u...@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+u...@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 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
>> clojure+u...@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+u...@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.


Demoralising experience trying to install on Win 7

2014-10-24 Thread Geoff Caplan
Hi

Wanting to get Clojure running on a Win 7 machine with no diskspace for 
dual boot. It's been a demoralising experience.

I tried the Win installer linked from the Leiningen website. It failed to 
download the Leiningen 1 jar - the shell simply flashed open and crashed.

Dug around the git site and found a recent .bat file that's supposed to 
work with the latest Leiningen 2. Again, the shell flashed and crashed.

Then manually downloaded the latest Leiningen 2 preview. Again running lein 
simply flashes and crashes the shell.

There's been a recent open issue on Windows installation but it's supposed 
to be fixed.

The lein.bat file is on my path and has exec permissions. I have Java 8 SDK 
installed and healthy.

Not sure where I go from here - any advice much appreciated.

I'm dithering between Clojure and Haskell for my next project. The Haskell 
community provide a well-maintained batteries-included Windows install for 
GHCi - I was in the Repl 60 seconds after visiting their site. I've been 
struggling with Leiningen for an hour and getting nowhere. 

It seems a great pity that the Clojure community seem to be ignoring those 
of us who are stuck with Windows - it must be having a negative effect on 
the uptake of the language. I see that this has been an issue for years, 
but hasn't been addressed. I'm more drawn to Clojure than to Haskell, but 
if I can't get it running I'll be forced to go elsewhere. Please help.

-- 
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: Demoralising experience trying to install on Win 7

2014-10-25 Thread Geoff Caplan

>
> Hi folks
>

Thanks for the suggestions!


   1. Sven - yes, I have the SDK for Java 8 and JAVA_HOME is set correctly
   2. Divyansh - thanks - Clooj works on my box, but as you say it's hardly 
   a long-term solution...
   3. Phillip - I've tried the installer, as I said, but it doesn't work. 
   And it's still targeting Leiningen 1. It's linked from the Leiningen 
   homepage but seems like a dead project. Not a great introduction to 
   Clojure...
   4. Laurent - thanks for the link to the standalone - didn't realise that 
   existed. Not an Eclipse fan - was going to try Light Table and fall back on 
   Emacs if I didn't like it. Just installed and it's as slow and cumbersome 
   as I expected, but I guess I could limp along with it if I absolutely had 
   to...

If there's any senior member of the community reading this - Windows still 
owns almost 90% of the desktop. The Leiningen site and the Clojure Getting 
Started page give essentially no help to Windows users, and Googling hasn't 
turned up a solution either. I'm no sysadmin but I'm a reasonably 
sophisticated developer and I'm stuck. Can you really afford to ignore this 
huge group? As I said, the Haskell community is light-years ahead of you 
here. 

So I would still very much appreciate a solution that would enable me to 
choose my editor freely...

-- 
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: Demoralising experience trying to install on Win 7

2014-10-25 Thread Geoff Caplan
Thanks for the tips, Jony - I've finally made it.

Here's the contrast between setting up Haskell and setting up Clojure:

*HASKELL*

1) Go to the homepage and download the Haskell Platform as an .exe
2) Install and use

*CLOJURE*

1) Go to the homepage and discover I have to go to the Leiningen site
2) Go the Leiningen site and get directed to the leiningen-win-installer 
site
3) Download the win-installer and discover that it's targeting an outdated 
version of Leiningen, which is academic as it doesn't work anyway
4) Go back to the Leiningen site and download the .bat file
5) Discover that it assumes you have wget
6) Find a Windows version of wget and put it in the path
7) Finally get self-install to run

No help for any of this on the Clojure or the Leiningen site. It's 
relatively straightforward once you know what to do, but it's far from 
straightforward to figure it out.

Given that Windows owns almost 90% of the desktop the community must be 
haemorrhaging 
potential members by placing so many obstacles in the path of new users. 
Millions of LAMP developers are used to coding on Windows and deploying to 
*nix. Given that one of the JVM's main selling points is its cross-platform 
capabilities, it just doesn't make sense that the community seems so 
*nix-centric.

If you want to promote adoption, surely you should emulate the Haskell 
example and offer an up-to-date, community supported .exe install that 
actually works?

-- 
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: Demoralising experience trying to install on Win 7

2014-10-25 Thread Geoff Caplan
Hi Andy

Thanks for the moderate and reasoned response! 

I've worked on Open Source projects myself and realise the realities. But 
this is a big project, and ignoring the needs of new Windows users is 
surely hurting it significantly? If this was prioritised, I suspect someone 
could be found to do this. Have you looked? As I keep saying, Haskell seems 
to have prioritised this, and make getting started easy for Windows, Mac 
and Linux.

At the very least, some clear and up-to-date instructions on the Getting 
Started page and Leningen homepage would be good start. Simply assuming 
that Windows users will be able to figure out all these steps while working 
in the dark is surely unrealistic? Linking to a broken install programme, 
and offering a .bat that uses wget without explaining how to get it working 
on Windows is seriously unhelpful, I would suggest...



On Saturday, 25 October 2014 15:49:21 UTC+1, Andy Fingerhut wrote:
>
> Geoff:
>
> I hesitated before replying, because I was concerned that anything I could 
> say other than "we'll get right on that" will sound at best like an excuse, 
> or at its worst like a dismissal.  The tone I am hoping to achieve here is 
> a neutral factual explanation.  Please try to read it that way.  I may also 
> be leaving out some relevant facts due to my ignorance.  If so, hopefully 
> someone else will add more facts to the conversation.
>
> Put yourself in the shoes of someone who maintains Clojure or Leiningen.  
> You don't personally use Windows for your development, and have no interest 
> in learning how to create a Windows installer.  You also don't have an 
> interest in paying someone to create one.  You are certainly open to the 
> possibility of someone else creating one, and linking to their results if 
> they produce something useful.
>
> One or a few people do, but there are problems with them, or they install 
> the most recent version available at the time, but new Clojure/Leiningen 
> versions are released later.  Those people decide it isn't in their 
> interest to improve/update them.  It is a (nearly) thankless job, and other 
> things are higher on their priority list.
>
> I think that is where we are.
>
> Andy (who has no interest in learning how to create a Windows installer)
>
> On Sat, Oct 25, 2014 at 7:17 AM, Geoff Caplan  > wrote:
>
>> Thanks for the tips, Jony - I've finally made it.
>>
>> Here's the contrast between setting up Haskell and setting up Clojure:
>>
>> *HASKELL*
>>
>> 1) Go to the homepage and download the Haskell Platform as an .exe
>> 2) Install and use
>>
>> *CLOJURE*
>>
>> 1) Go to the homepage and discover I have to go to the Leiningen site
>> 2) Go the Leiningen site and get directed to the leiningen-win-installer 
>> site
>> 3) Download the win-installer and discover that it's targeting an 
>> outdated version of Leiningen, which is academic as it doesn't work anyway
>> 4) Go back to the Leiningen site and download the .bat file
>> 5) Discover that it assumes you have wget
>> 6) Find a Windows version of wget and put it in the path
>> 7) Finally get self-install to run
>>
>> No help for any of this on the Clojure or the Leiningen site. It's 
>> relatively straightforward once you know what to do, but it's far from 
>> straightforward to figure it out.
>>
>> Given that Windows owns almost 90% of the desktop the community must be 
>> haemorrhaging 
>> potential members by placing so many obstacles in the path of new users. 
>> Millions of LAMP developers are used to coding on Windows and deploying to 
>> *nix. Given that one of the JVM's main selling points is its cross-platform 
>> capabilities, it just doesn't make sense that the community seems so 
>> *nix-centric.
>>
>> If you want to promote adoption, surely you should emulate the Haskell 
>> example and offer an up-to-date, community supported .exe install that 
>> actually works?
>>
>> -- 
>> 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
>> clojure+u...@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 e

Re: Demoralising experience trying to install on Win 7

2014-10-26 Thread Geoff Caplan
Hi folks 

Impressed that you've responded to my grumpy old man act so constructively 
- many thanks!

Stu - I was aware that I could run the REPL without Leiningen - the Minimal 
Install section is pretty clear. But there didn't seem much point in having 
Clojure without any access to the build tool and package management, so 
that's the way I went. I'm guessing most newbies with serious intent would 
be doing the same? 

>From what I've heard, Leiningen is more user-friendly than Haskell's Cabal, 
so it seems the team at Technomancy are doing a great job - it's just that 
this issue seems to be a bit of a blind-spot.

My failure to see the errors in the shell was my bad, I guess. I'm pretty 
fluent in bash but have never had a need for the Windoze shell except for 
the odd ping and .bat file, and I'd got into the habit of running .bats by 
double-clicking. But there does seem to be a lack of focus and coordination 
on the Windows issue, and it seems unwise to assume that all Windows users 
are going to have the skills to work around broken scripts. 

As an outsider, it seems to me that the most practical next steps would be:

1) Write an idiot-proof step-by-step guide to installing Leiningen in 
Windows that's clearly linked from the Leiningen homepage.
2) Set up some kind of coordination between David Powell and the Leiningen 
team to ensure that they don't break leiningen-win-installer when they edit 
the .bat. (At present, David's offering curl and the .bat's expecting to 
find wget, which is hardly a standard feature on most Windows boxes...)

Does that make any kind of sense?

By the way - initial impressions are that the struggle will be well worth 
it - I'm really enjoying getting into Clojure. Took a look at 1.0 but 
decided to wait till the native libs matured. I've always felt that the 
benefits of OOP are over-hyped and have always been drawn to the functional 
paradigm but Lisp and Scheme were never very practical for me. Now we have 
a modern Lisp with access to a huge ecosystem - I've been waiting 20 years 
for this! Many thanks to everyone who has worked so hard to make this 
possible.

Geoff

-- 
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: FleetDB or other "NoSQL" store for Clojure?

2011-07-16 Thread Geoff Wilson
I’ve found the MongoDB integration to Clojure to be really good for most of 
what I wanted for my app. With the Congomongo driver, you very strongly tick 
off the first two points, but I don’t think it will go so well with your other 
constraints.

Mongo explicitly excludes transactions 
(http://www.mongodb.org/display/DOCS/Developer+FAQ#DeveloperFAQ-HowdoIdotransactions%2Flocking%3F)
 and instead provides support for atomic updates on individual documents. If 
you can fit your data model for your transaction into a single document you may 
be okay. This seems to be a more common schema for NoSQL type DBs, where the 
documents themselves are quite large, rather than lots of smaller entries 
joined in many tables for a relational DB.

Thanks,

Geoff

On 15/07/2011, at 5:09 PM, Timothy Washington wrote:

> I've actually tried FleetDB, and describe here, what I found. I didn't go 
> with it, and chose MongoDB instead. At the time, Congomongo didn't support DB 
> references. Bit it has since added  DB reference support. I have yet to try 
> them out, but they look promising. 
> 
> HTH 
> Tim
> 
> 
> On Fri, Jul 15, 2011 at 3:17 AM, Marko Kocić  wrote:
> Hi all,
> I would like to try out some of those "no-sql" datastores for my next 
> project, and need an advice which one, since I never used the one before.
> It needs to fulfill at least some of those following criteria, in order of 
> importance:
> 
> - is nicelly supported by Clojure (by this I mean idiomatic clojure "driver", 
> not java plain java wrapper")
> - it should be schemaless
> - it should support transactions
> - it's good if it can be used as embedded db
> - it doesn't have to support large datasets (in-memmory is ok)
> - it has to run on both Windows and Linux
> 
> My first choice would be FleetDB, since it was written in Clojure and 
> examples look nice, but I'm not sure if it is abandonware or not, and I 
> havent heard that people are actually using it in production.
> 
> What are my other options?
> 
> Regards,
> Marko
> 
> -- 
> 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 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 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

Re: Is there a reason that def- isn't part of the core lib?

2011-09-19 Thread Geoff Wilson
Wouldn't a set of standard entries in a lein project file be sufficient for a 
beginner? 

I’m not sure that Clojure needs something as packaged as the Haskell Platform 
(http://hackage.haskell.org/platform/), and it certainly should not be part of 
core.


On 19/09/2011, at 4:33 PM, Stuart Halloway wrote:

>> I also think it is worth remembering the difficulty people have with getting 
>> started with Clojure (wrt to IDEs).  There are *so* many third party 
>> libraries out there at the moment that a beginner could easily be 
>> overwhelmed.  The more self contained and feature complete the core is the 
>> better.
> 
> A self contained complete starter env (e.g. including all the modular 
> contribs) is a good idea. It should not be core.
> 
> Stu
> 
> 
> 
> -- 
> 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 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


Re: Interested in a port of Ruby's String#unpack

2011-12-26 Thread Geoff Salmon
Hi, does the unpack function in this library do what you're looking
for? https://github.com/geoffsalmon/bytebuffer
It unpacks values from Java's ByteBuffer objects instead of strings,
which seemed more appropriate in Java-land.

I haven't touched the code since Clojure 1.2, but if it looks useful I
can try to bring it up to date.

- Geoff

On Dec 26, 10:03 pm, mrb_bk  wrote:
> I also thought I would mention that I've been hanging out in #clojure
> as mrb_bk - please hit me up if you would like to chat about this.
>
> On Dec 26, 10:08 am, mrb_bk  wrote:
>
>
>
>
>
>
>
> > Hey Everyone:
>
> > I'm working on a project in Clojure that involves parsing binary data
> > files.  Specifically, I'm building a tool for analyzing Redis (http://
> > redis.io) dump files (.rdb format).  The very beginnings of this
> > nascent project are here:http://github.com/mrb/pianist.  I am a
> > beginner to Clojure and Lisp in general, but I'm a long time Ruby
> > programmer with experience in C, Java, etc.  During the course of
> > working through some Clojure learning materials and general poking
> > around the web and #clojure in IRC, I've noticed that one of my
> > favorite tools for working with binary data from Ruby is missing in
> > the Java/Clojure world.  This is String#unpack:
>
> >http://www.ruby-doc.org/core-1.9.3/String.html#method-i-unpack
>
> > After a brief Twitter conversation with @abedra, and while I get the
> > chance to submit my contributors agreement in order to access Clojure-
> > dev, I thought I'd bring this topic up here.
>
> > For what it's worth, I've checked out Gloss, which is interesting but
> > a bit too opinionated for me.  Plus I believe that something to this
> > effect should be part of clojure core - it seems that easy interface
> > for lazily handling binary data as seqs doesn't exist as such right
> > now.
>
> > If anyone has comments on the beginnings of my codebase (be gentle),
> > or thoughts about implementing something similar to String#unpack, or
> > a suggestion of an alternative set of tools I could use, that would be
> > great.  Thanks!
>
> > Mike
> > twitter.com/mrb_bk
> > github.com/mrb

-- 
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


Re: Interested in a port of Ruby's String#unpack

2011-12-27 Thread Geoff Salmon
I've pushed some updates to get it running with 1.3. take-ulong is
still broken because clojure.lang.BigInt doesn't seem to support bit-
and, but if you don't need that, give it a shot.

On Dec 27, 9:11 am, mrb_bk  wrote:
> This looks great, take-ubyte is basically exactly what I needed.  I'll
> let you know if it works when I try it out this afternoon -- not sure
> what kind of work needs to be done to bring it up to date.
>
> On Dec 27, 1:03 am, Geoff Salmon  wrote:
>
>
>
>
>
>
>
> > Hi, does the unpack function in this library do what you're looking
> > for?https://github.com/geoffsalmon/bytebuffer
> > It unpacks values from Java's ByteBuffer objects instead of strings,
> > which seemed more appropriate in Java-land.
>
> > I haven't touched the code since Clojure 1.2, but if it looks useful I
> > can try to bring it up to date.
>
> > - Geoff
>
> > On Dec 26, 10:03 pm, mrb_bk  wrote:
>
> > > I also thought I would mention that I've been hanging out in #clojure
> > > as mrb_bk - please hit me up if you would like to chat about this.
>
> > > On Dec 26, 10:08 am, mrb_bk  wrote:
>
> > > > Hey Everyone:
>
> > > > I'm working on a project in Clojure that involves parsing binary data
> > > > files.  Specifically, I'm building a tool for analyzing Redis (http://
> > > > redis.io) dump files (.rdb format).  The very beginnings of this
> > > > nascent project are here:http://github.com/mrb/pianist.  I am a
> > > > beginner to Clojure and Lisp in general, but I'm a long time Ruby
> > > > programmer with experience in C, Java, etc.  During the course of
> > > > working through some Clojure learning materials and general poking
> > > > around the web and #clojure in IRC, I've noticed that one of my
> > > > favorite tools for working with binary data from Ruby is missing in
> > > > the Java/Clojure world.  This is String#unpack:
>
> > > >http://www.ruby-doc.org/core-1.9.3/String.html#method-i-unpack
>
> > > > After a brief Twitter conversation with @abedra, and while I get the
> > > > chance to submit my contributors agreement in order to access Clojure-
> > > > dev, I thought I'd bring this topic up here.
>
> > > > For what it's worth, I've checked out Gloss, which is interesting but
> > > > a bit too opinionated for me.  Plus I believe that something to this
> > > > effect should be part of clojure core - it seems that easy interface
> > > > for lazily handling binary data as seqs doesn't exist as such right
> > > > now.
>
> > > > If anyone has comments on the beginnings of my codebase (be gentle),
> > > > or thoughts about implementing something similar to String#unpack, or
> > > > a suggestion of an alternative set of tools I could use, that would be
> > > > great.  Thanks!
>
> > > > Mike
> > > > twitter.com/mrb_bk
> > > > github.com/mrb

-- 
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


Re: Interested in a port of Ruby's String#unpack

2011-12-29 Thread Geoff Salmon
I think I fixed the take-ulong problem, and I've pushed 0.2.0 to
clojars. Let me know if you have any problems with it.

- Geoff

On Dec 27, 12:47 pm, Geoff Salmon  wrote:
> I've pushed some updates to get it running with 1.3. take-ulong is
> still broken because clojure.lang.BigInt doesn't seem to support bit-
> and, but if you don't need that, give it a shot.
>
> On Dec 27, 9:11 am, mrb_bk  wrote:
>
>
>
>
>
>
>
> > This looks great, take-ubyte is basically exactly what I needed.  I'll
> > let you know if it works when I try it out this afternoon -- not sure
> > what kind of work needs to be done to bring it up to date.
>
> > On Dec 27, 1:03 am, Geoff Salmon  wrote:
>
> > > Hi, does the unpack function in this library do what you're looking
> > > for?https://github.com/geoffsalmon/bytebuffer
> > > It unpacks values from Java's ByteBuffer objects instead of strings,
> > > which seemed more appropriate in Java-land.
>
> > > I haven't touched the code since Clojure 1.2, but if it looks useful I
> > > can try to bring it up to date.
>
> > > - Geoff
>
> > > On Dec 26, 10:03 pm, mrb_bk  wrote:
>
> > > > I also thought I would mention that I've been hanging out in #clojure
> > > > as mrb_bk - please hit me up if you would like to chat about this.
>
> > > > On Dec 26, 10:08 am, mrb_bk  wrote:
>
> > > > > Hey Everyone:
>
> > > > > I'm working on a project in Clojure that involves parsing binary data
> > > > > files.  Specifically, I'm building a tool for analyzing Redis (http://
> > > > > redis.io) dump files (.rdb format).  The very beginnings of this
> > > > > nascent project are here:http://github.com/mrb/pianist.  I am a
> > > > > beginner to Clojure and Lisp in general, but I'm a long time Ruby
> > > > > programmer with experience in C, Java, etc.  During the course of
> > > > > working through some Clojure learning materials and general poking
> > > > > around the web and #clojure in IRC, I've noticed that one of my
> > > > > favorite tools for working with binary data from Ruby is missing in
> > > > > the Java/Clojure world.  This is String#unpack:
>
> > > > >http://www.ruby-doc.org/core-1.9.3/String.html#method-i-unpack
>
> > > > > After a brief Twitter conversation with @abedra, and while I get the
> > > > > chance to submit my contributors agreement in order to access Clojure-
> > > > > dev, I thought I'd bring this topic up here.
>
> > > > > For what it's worth, I've checked out Gloss, which is interesting but
> > > > > a bit too opinionated for me.  Plus I believe that something to this
> > > > > effect should be part of clojure core - it seems that easy interface
> > > > > for lazily handling binary data as seqs doesn't exist as such right
> > > > > now.
>
> > > > > If anyone has comments on the beginnings of my codebase (be gentle),
> > > > > or thoughts about implementing something similar to String#unpack, or
> > > > > a suggestion of an alternative set of tools I could use, that would be
> > > > > great.  Thanks!
>
> > > > > Mike
> > > > > twitter.com/mrb_bk
> > > > > github.com/mrb

-- 
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