Error throw when defining function with return type hint

2014-02-10 Thread macdevign mac
Hi, I'm new to the clojure and try to learn this language. Referring to this at http://clojure.org/java_interop#Java%20Interop-Type%20Hints when trying this code (defn testing (^String []) (.toUpperCase hello world)) clojure throws java.lang.IllegalArgumentException: Parameter

Re: Error throw when defining function with return type hint

2014-02-10 Thread macdevign mac
I get it. Thank :} On Monday, February 10, 2014 11:19:06 PM UTC+8, Jim foo.bar wrote: On 10/02/14 15:08, macdevign mac wrote: (defn testing (^String []) (.toUpperCase hello world)) ;;syntax for overloading (defn testing (^String [] ;;notice the omitted bracket

ANN: clj-vorbis

2011-10-10 Thread mac
Hello all. I have made a small clojure wrapper around the jorbis library from jcraft (for decoding ogg vorbis compressed audio). I'm planning to maybe use it as a component in a small game library but I made it as a stand alone library because it could really be useful in any app dealing with

Re: using swig in clojure

2010-11-26 Thread mac
On Nov 19, 3:44 pm, Seth wbu...@gmail.com wrote: unfortunately doesnt work. The library loads succesfully but i still get the error when calling add. Note that compiling on the top is a workaround to get it working on the repl. i added the loadlibrary to an init function which is good and i

Re: using swig in clojure

2010-11-05 Thread mac
System/loadLibrary uses the paths set in the System property java.library.path to look for dynamic libraries so you need to make sure it contains the directory where your .so is. I think it also gets cached at first read or something stupid like that so it's very important to get java.library.path

Re: Generating special classes

2010-10-07 Thread mac
me a mail if you have problems, requests or suggestions. /Markus On Wed, Oct 6, 2010 at 07:21, mac markus.gustavs...@gmail.com wrote: There is always clojure.asm if you don't mind getting your hands dirty with bytecode generation. That's what I did when I needed exactly what you describe

Re: Generating special classes

2010-10-05 Thread mac
There is always clojure.asm if you don't mind getting your hands dirty with bytecode generation. That's what I did when I needed exactly what you describe for clj-native. It wasn't that much work, the JVM bytecode is uncomplicated to begin with and since JNI method stubs require no code all you

Re: clojure Image/video processing?

2010-09-08 Thread mac
Thank you Mark Downie for recommending OpenCL, I'll start playing around with it.  As for accessing the c libraries directly, I'm afraid I don't know much about JNI to do it from clojure.  Do you or anyone know of a good way to start with JNI in clojure? If you are going to use a straight C

Re: RFC: New Clojure launcher

2010-08-16 Thread mac
Correction: you will need the jdk on windows when using the 32 bit build because the server jvm does not come with the 32 bit jre. Perhaps I should just make it prefer the server jvm, not require it. On Aug 15, 6:12 pm, mac markus.gustavs...@gmail.com wrote: On Aug 15, 6:02 pm, Wilson MacGyver

RFC: New Clojure launcher

2010-08-15 Thread mac
. The readme and code is over here: http://github.com/bagucode/Carnival If you don't want to compile C++ or can't get the projects working (I may have used some machine-specific paths) I have made some prebuilt binaries for your testing pleasure. Mac OS X version requires jre 1.6, Windows version should

Re: RFC: New Clojure launcher

2010-08-15 Thread mac
On Aug 15, 6:02 pm, Wilson MacGyver wmacgy...@gmail.com wrote: This still requires JDK installed right? On the OSX version, does it create DMG file? Since for an end user OSX app, that's what people expect. It requires JRE installed, not JDK. It comes with the OS on everything but windows but

Re: Game development in Clojure

2010-08-13 Thread Mac
On Aug 13, 9:51 am, Mike Anderson mike.r.anderson...@gmail.com wrote: 2. It would be great to reduce the amount of memory allocations. Yes, I know memory is plentiful and GC is very cheap, but it's still not as cheap as stack allocation and any noticeable GC pauses are not good for the

Re: jna Java Native Acess and clojure ....

2010-08-11 Thread mac
questions; philosophy questions answers. On Aug 10, 2010, at 6:29 AM, Sunil S Nandihalli wrote: Thanks Mac for your clarification .. I am using clojure 1.2 .. so should be fine. And I was wondering if I can acess c++ stuff via clj-native .. What are your suggestions? Sunil On Tue, Aug 10

Re: jna Java Native Acess and clojure ....

2010-08-11 Thread mac
On Aug 11, 4:26 pm, Chouser chou...@gmail.com wrote: On Wed, Aug 11, 2010 at 5:18 AM, mac markus.gustavs...@gmail.com wrote: It is certainly theoretically possible to call C++ from Clojure/Java but it requires deep knowledge and lots of code for each C++ compiler one would like to support

Re: jna Java Native Acess and clojure ....

2010-08-10 Thread mac
I'm the author of clj-native. Currently it only works with Clojure 1.2. In retrospect I should have made a separate branch when dropping 1.1 support. If you need 1.1 support, just tell me and I could make a branch for it since the changes required should be small. /Markus On Aug 9, 5:31 pm,

Re: ANN: CDT - The Clojure Debugging Toolkit

2010-07-07 Thread mac
I agree with Laurent, this looks very cool. It's great that you are making it a text/repl interface because that means it's decoupled from any particular editor and can easily be used as a base for gui debuggers in different editors and IDEs. /Markus On Jul 7, 7:39 am, George Jahad

Re: Version of netbeans with extra Clojure and Polyglot Maven/Leiningen support ...

2010-04-12 Thread mac
Yes, this is very interesting and I would love to try it. Since I do most of my programming on a mac, a .dmg file would work fine for me. On 9 Apr, 16:18, Antony Blakey antony.bla...@gmail.com wrote: I have a private build of Netbeans that adds the following features to the maven support: 1

Re: concurrency and rand-int

2010-03-26 Thread mac
  lspec...@hampshire.edu wrote: I'm trying to track down the reason that I sometimes see a lot of   concurrency in my system (up to 1200% CPU utilization on a dual   quadcore mac that also has some kind of hyperthreading, allegedly   allowing a maximum of 1600% CPU) while other times it gets

Re: Clojure/LLVM

2010-03-24 Thread mac
Like Per says, if you want to compile Clojure to LLVM code that's probably a huge project, have you looked at VMKit? I think that's a JVM/CLR implementation based on LLVM, perhaps it could run Clojure? If you just want to use LLVM from Clojure however, you can use my C FFI clj-native with the C

Re: Clojure/LLVM

2010-03-24 Thread mac
also has facilities to create ByteBuffers from pointers which means you can gain access to large blobs of memory that reside in native code. On 24 mar, 08:56, Konrad Hinsen konrad.hin...@fastmail.net wrote: On 24 Mar 2010, at 07:40, mac wrote: If you just want to use LLVM from Clojure however

Re: Clojure/LLVM

2010-03-24 Thread mac
of method calls. On the native side you should be able to get a direct pointer to the memory in the buffer so you can just go crazy and do whatever you like (hello segfault) ;) On Mar 24, 3:17 pm, Konrad Hinsen konrad.hin...@fastmail.net wrote: On 24.03.2010, at 11:22, mac wrote: With regards

Name suggestions

2010-03-17 Thread mac
, could just be something that sounds funny, like sasquatch, that's a funny word. Please help! /Markus On 13 mar, 19:14, mac markus.gustavs...@gmail.com wrote: Hello all. I have had some time lately to work on my C FFI for Clojure and I think it's pretty much feature complete now. It has support

[ANN] clj-native 0.8.1

2010-03-13 Thread mac
Hello all. I have had some time lately to work on my C FFI for Clojure and I think it's pretty much feature complete now. It has support for functions, callbacks, structures, unions and globals. For structures there is support for different alignments. The library has two main namespaces:

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-04 Thread mac
The .m2 folder is a Maven 2 convention. Leiningen uses Maven internally. .m2 contains your local repository - the single standard place where stuff gets downloaded to. When doing lein deps in a project folder any dependencies are downloaded to your local repo first (unless you already had the

Re: How to Initiate Clojure Application

2010-02-01 Thread mac
Is -main special in any way, or is this just a convention that some environments select? In the past I think I've used a manifest to specify the main entry point... is that really necessary or does -main map to the default main entry point regardless of build tool? Just curious really! I

Re: Full Disclojure - I Need Topics!

2010-01-25 Thread mac
On 25 Jan, 12:18, Joonas Pulakka joonas.pula...@gmail.com wrote: I would be interested in native / C interoperability; perhaps either (or both) of these libraries: http://github.com/bagucode/clj-native http://github.com/Chouser/clojure-jna And others, if there are similar ones. In general,

Re: C interop lib (JNA wrapper)

2010-01-25 Thread mac
?list=devmsgNo=808 (I realize that this would basically be the generate callback classes OTF solution that I said I'd rather not do, but if the code for this already exists I could be persuaded otherwise.) Cheers ..Mark.. On Sun, Jan 24, 2010 at 8:54 AM, mac markus.gustavs...@gmail.com wrote

Re: C interop lib (JNA wrapper)

2010-01-24 Thread mac
A little progress update. I havent had much time to work on this since my initial effort. But this weekend I have gotten structures to work. The reason that special support for structures is needed is to support C api's that pass them by value. Most of the effort to make this work went into how I

Re: Full Disclojure - I Need Topics!

2010-01-24 Thread mac
On 25 Jan, 06:50, Mark Engelberg mark.engelb...@gmail.com wrote: Debugging techniques, including: * How to make sense of Clojure's stack traces. * How to use Java debugging and profiling tools with Clojure. +1 for this. I haven't had the energy to try any debugging or profiling tools yet.

Re: Question about Responsiveness of Garbage Collection

2010-01-20 Thread mac
If you are talking about gui's written in swing you might have more luck with AWT since that is supposed to be using native gui components rather than doing it's rendering in java. I suspect that the sluggishness of swing is due to the fact that it has to copy a lot of data between the java heap

Re: ANN: dgraph 1.0, a dependency graph library for Clojure

2010-01-17 Thread mac
Using the clojars repo from leiningen works fine for me, just using [dgraph 1.0.0]. I've done most of my little swing app I needed to get done and dgraph has been very pleasant. However I found myself wanting to put a map in the graph because I had a function for updating the gui that depended on

Re: I'm going to teach Clojure at university - suggestions/comments?

2010-01-13 Thread mac
The issue that is particularly interesting to me to explore is how alien Clojure is to Java programmers, what are subjective and objective causes, and how hard is to overcome each of the identified issues. This sounds very interesting. I try to explain the point of lisp to java programmers

Re: C interop lib (JNA wrapper)

2010-01-12 Thread mac
I had apparently forgotten to commit and push the last changes. Sorry for any trouble if anyone is trying to use the library. The callbacks should work now. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: C interop lib (JNA wrapper)

2010-01-10 Thread mac
This is great. I think it'll be very valuable to call out to a bunch of useful C library functions. Thank you Can this approach also provide a bridge to Objective-C? I'm very interested in using Cocoa to design GUIs for the Mac.  I'd really like to be able to have all the business logic

Re: C interop lib (JNA wrapper)

2010-01-09 Thread mac
I've gotten rid of the automatic loading of the library and replacement of stub functions upon their first call. While this seemed convenient I didn't like that the stub versions of the functions could be passed around as objects without the user knowing that it was not the real version being

C interop lib (JNA wrapper)

2010-01-08 Thread mac
Hello all. I've started work on a clojure library for interoperating with C. It's always been a pain to do in Java but recently JNA (java native access) has taken away most of that pain. When using clojure however, it's nice to be able to stay in clojure and not drop to java (or C *shudder*). It's

Re: C interop lib (JNA wrapper)

2010-01-08 Thread mac
On Jan 8, 8:53 pm, Rob Wolfe r...@smsnet.pl wrote: mac markus.gustavs...@gmail.com writes: Hello all. I've started work on a clojure library for interoperating with C. It's always been a pain to do in Java but recently JNA (java native access) has taken away most of that pain. When

Re: Clojure and c++ and a bit more

2009-12-25 Thread mac
On Dec 24, 6:14 pm, atucker agjf.tuc...@googlemail.com wrote: I am also curious about this.  Apologies, possibly naive question ahead :) My background is in C++.  By choosing to work with immutable values (i.e. with a lot of consts), I found that I was able to avoid most of explicit memory

Re: Clojure and c++ and a bit more

2009-12-22 Thread mac
in particular seems interesting because one of their goals is to make a very efficient GC and the language is somewhat multicore aware. /mac -- 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

Re: Help recreating OS X Leiningen 1.0 +Swank bug

2009-12-18 Thread mac
I think I have solved the arguments issue but I had a strange bug with clojure.test which worries me a little bit. If you can try this out and see if it works for you that would be great: http://github.com/bagucode/leiningen/tree/setfork /mac On Dec 17, 7:02 pm, Steve Purcell st...@sanityinc.com

Re: Help recreating OS X Leiningen 1.0 +Swank bug

2009-12-17 Thread mac
I've looked into it a little and this is probably a solvable problem. Since my native code patch needs fork as well I will try an idea I have later today. /mac On Dec 17, 7:02 pm, Steve Purcell st...@sanityinc.com wrote: I came across this problem too, and David's patch helps, to a certain

Re: Leiningen Run ?

2009-12-13 Thread mac
, when trying to build penumbra with it, it still fails with an UnsatisfiedLinkError. It seems like setting the java.library.path property in the ant task in eval-in-project is ignored..? /Mac -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Binary compatibility and a culture of AOT abuse

2009-12-13 Thread mac
deployed something broken on your dev machine. But if the time difference is not noticeable, then I certainly agree with you for open source projects. /Mac -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: ClojureCLR questions

2009-12-03 Thread mac
Apologies if this has been answered, did a quick search but found only pieces of info. Is it possible to run ClojureCLR on Mono yet? There was an issue with the BigDecimal dependency from J#? /Markus On Dec 3, 5:21 am, dmiller dmiller2...@gmail.com wrote: 1. CLR Interop:  Interop is the focus

Re: leiningen - a Clojure build tool

2009-11-19 Thread mac
On Nov 19, 8:50 am, Martin DeMello martindeme...@gmail.com wrote: On Thu, Nov 19, 2009 at 10:52 AM, Phil Hagelberg p...@hagelb.org wrote: I must confess I don't understand the avoid the command-line mindset at all, so I need a little extra explanation. It's a matter of context switching.

Re: I got to use Clojure at work today !!!

2009-03-17 Thread mac
On Mar 17, 4:54 am, Paul Mooser taron...@gmail.com wrote: I've been using clojure in a similar way at work. I run a swank server in a separate thread inside of a running application instance, and I can connect to it remotely using SLIME. It works pretty well! Me too, I put a swank server in

Re: How can I make the smallest structure possible?

2009-03-10 Thread mac
Arrays also have some overhead though so if your objects are all of equal size you could use just one array (of ints?) for all of them and create functions for indexing correctly in your array. A bit brittle but very space efficient. Of course this throws all of the benefits of Clojure or even

Re: Internal structure of evaluation results

2009-03-02 Thread mac
There is meta data on var's which you need to use (meta (var sym)) to get at, but I'm under the impression that the var metadata is mostly for the benefit of the language runtime and a few core functions (like doc). The regular use of metadata I think is when you add it yourself to symbols or

Re: Clojure indentation conventions

2008-12-03 Thread mac
On 4 Dec, 02:14, Mark Volkmann [EMAIL PROTECTED] wrote: On Wed, Dec 3, 2008 at 4:49 PM, Meikel Brandmeyer [EMAIL PROTECTED] wrote: Hi, Am 03.12.2008 um 22:06 schrieb levand: I am coming to Clojure from the Java side, and am completely ignorant about lisp indentation newline

Re: Clojure for LISP programmers....

2008-11-17 Thread mac
On Nov 17, 4:52 am, Luc Prefontaine [EMAIL PROTECTED] wrote: I never read anywhere in the documentation or in the user group that Clojure is a Common LISP implementation. Since it's existence, LISP has not gained a large acceptance in the commercial market compared to other conventional

Re: Patch: standalone compiler (almost)

2008-11-16 Thread mac
On Nov 17, 4:34 am, Rich Hickey [EMAIL PROTECTED] wrote: On Nov 16, 9:47 pm, Stuart Sierra [EMAIL PROTECTED] wrote: Hi Rich, and all, I took a stab at writing a static compiler class, i.e. a main() that just compiles all the .clj files on the command line and saves the .class files.

Re: Why are symbols resolved when a function is defined?

2008-11-11 Thread mac
On 11 Nov, 06:24, Paul Barry [EMAIL PROTECTED] wrote: In Common Lisp and Scheme, if you have an expression that evaluates a symbol, it doesn't evaluate it until you call the function, not when you define it.  So you can do this: Common Lisp: [1] (defun b () a) B [2] (defvar a 5) A [3]

Re: A trivial question about type and class

2008-11-05 Thread mac
/mac --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit

Re: Modified doto

2008-10-27 Thread mac
doto. /mac --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options

Re: Modified doto

2008-10-24 Thread mac
be a very nice change. /mac --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED

Re: Cells in Clojure

2008-09-23 Thread mac
...) If this was not intended, a way to fix it is to make the update-cell into a single call, perhaps taking the update function as an argument rather than reading it from the cell state. But like I said I've not completely understood the code so please don't be mean to me if this was a retarded thing to point out :) /mac