Java interop question

2008-12-14 Thread David
work> (.getName (.getClass 0)) "java.lang.Integer" work> (.getName java.lang.Integer) ; Evaluation aborted. Why does the second expression fail? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: Stumped - Java hangs when using Swing in Slime

2009-02-05 Thread David
I've got the same problem as srolls24 and CuppoJava on Windows XP, using Emacs 23 and versions of Clojure, Slime and Swank fetched today. Also, when starting Slime, it opens a connection to *inferior-lisp*, but keeps polling for Swank until I hit return in the inferior-lisp buffer. After that, i

Re: Stumped - Java hangs when using Swing in Slime

2009-02-12 Thread David
ot;sroll...@gmail.com" wrote: > On Feb 5, 1:52 am, David wrote: > > > I've got the same problem assrolls24and CuppoJava on Windows XP, > > using Emacs 23 > > and versions of Clojure, Slime and Swank fetched today. > > > Also, when starting Slime, it open

Re: My SLIME installation diary

2009-02-13 Thread David
I have a small problem with clojure-mode in your setup. Since clojure-mode is autoloaded, it, and SLIME, aren't available until I load a '.clj' file. Starting SLIME, though, doesn't add the SLIME menu to the previously loaded '.clj' buffer (Newly loaded files get the menu, as they should). Thank

Re: My SLIME installation diary

2009-02-18 Thread David
buffer already had slime-mode -- love to hear from someone who is actually handy with elisp! On Feb 13, 4:39 pm, Phil Hagelberg wrote: > David writes: > > I have a small problem with clojure-mode in your setup. > > > Since clojure-mode is autoloaded, it, and SLIME, aren&#x

Re: My SLIME installation diary

2009-02-19 Thread David
On Feb 18, 6:34 pm, Phil Hagelberg wrote: > David writes: > The Elisp CL emulation package is documented in its own top-level Info > node for some reason rather than in the Elisp manual. Almost certainly historical -- it must be a later, separate development. It really should be list

Internal structure of evaluation results

2009-03-01 Thread David
uments ;-) ) // keys == meta names in a sentence: something that could be parsed from within Java using java.lang.String and Java collection classes? Regards, David --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Internal structure of evaluation results

2009-03-02 Thread David
:doc "Returns the metadata of obj, returns nil if there is no metadata.", :file "boot.clj", :ns #, :name meta, :arglists ([obj])} Allelluyah! But... if such an example would be right there in the docs I got with the (find-doc "metadata"), I'd get where I want to b

Re: Internal structure of evaluation results

2009-03-02 Thread David
On Mar 2, 12:37 pm, Mark Volkmann wrote: > Are you saying that you wanted the metadata of the meta function? No, I just used it to illustrate that the Clojure documentation is not as well organized and intuitive as some would have us believe. Regards, Da

Re: Internal structure of evaluation results

2009-03-02 Thread David
On Mar 2, 3:04 pm, Michael Wood wrote: > I don't think David is having trouble finding the documentation for > meta.  He's complaining that the output of (doc meta) does not tell > you that you need to use (meta (var meta)) instead of (meta 'meta) or > (meta meta)

Re: Adding implicit indexing to Clojure lists and arrays?

2013-07-03 Thread david
(defn indexed "Returns a lazy sequence of [index, item] pairs, where items come from 's' and indexes count up from zero. (indexed '(a b c d)) => ([0 a] [1 b] [2 c] [3 d])" [s] (map vector (iterate inc 0) s)) -- -- You received this message because you are subscribed to the Google Grou

Re: ANN: ClojureScript 0.0-1877 (Breaking change)

2013-09-09 Thread david
A large percentage of tests for my core.async based library are failing. Any thoughts? -- -- 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 -

Code re-use in Speclj

2014-02-04 Thread david
"context" might be what you're looking for. -- 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 unsu

Code re-use in Speclj

2014-02-04 Thread david
You can also use let instead of with. If you have multiple tests inside let wrap them in a context call. -- 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 a

ANN: [lein-describe 0.1.0] plugin for displaying detailed information about Clojure projects

2014-02-04 Thread david
Looks cool. I'll be sure to check it out. -- 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 unsubs

stch.schema a Prismatic Schema fork

2014-02-06 Thread david
Please check out the repo README page for motivations and differences. Thanks so much to the Prismatic people for open sourcing Schema. It's awesome and I love it. Some of my changes seemed too different to even consider a pull request, so I decided to create my own fork. All feedback is we

Re: stch.schema a Prismatic Schema fork

2014-02-07 Thread david
Thanks for pointing that out. Changed defn*, defrecord*, fn*, letfn* to defn', defrecord', fn', and letfn'. Added tests for fn' and letfn'. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.co

[ANN] stch.routing 0.1.1

2014-03-19 Thread david
mples, and example site can be found at https://github.com/stch-library/routing. Add the following to your project dependencies to use: [stch-library/routing "0.1.1"] BTW, I'm currently looking for work as a Clojure developer. If you like what you see, please hit me up. David -

[ANN] stch.dom 0.1.0 - A new jQuery-like DOM manipulation library for ClojureScript

2014-03-20 Thread david
https://github.com/stch-library/dom Add the following to your project dependencies to use: [stch-library/dom "0.1.0"] BTW, I'm currently looking for work as a Clojure developer. If you like what you see, please hit me up. David -- You received this message because you are su

[ANN] stch.html 0.1.0 - A brand new library for HTML generation that supports Clojure and ClojureScript

2014-03-20 Thread david
(footer "Copyright 2014" BTW, I'm currently looking for work as a Clojure developer. If you like what you see, please hit me up. David -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

[ANN] stch.schema 0.3.3 - Optional type annotations and type checking

2014-03-23 Thread david
. stch.schema is on Clojars as well. Add the following to your project dependencies to use: [stch-library/schema "0.3.3"] BTW, I'm currently looking for work as a Clojure developer. If you like what you see, please hit me up. David -- You received this message because you ar

Re: [ANN] stch.schema 0.3.3 - Optional type annotations and type checking

2014-03-23 Thread david
Forgot github link: https://github.com/stch-library/schema -- 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 firs

Re: [ANN] stch.html 0.1.0 - A brand new library for HTML generation that supports Clojure and ClojureScript

2014-03-23 Thread david
0.1.2 released. class attribute can be a string, set, or sequential type now. (->html (div :class "big bold")) ; "" (->html (div :class #{"big" "bold"})) ; "" (->html (div :class ["big" "bold"])) ; "" -- You received this message because you are subscribed to the Google Groups "Clojure" group

[ANN] stch.sql 0.1.0 - A DSL for SQL query, DML, and DDL

2014-03-26 Thread david
eign-key :orgID '(orgs orgID) :on-delete-cascade)) (change :username (varchar :username [100])) (drop-default :ranking) (set-default :ranking 1) (drop-column :countryCode) (drop-index :uname) (drop-primary-key) (drop-foreign-key :fk1))) BTW, I'

REPL Reloaded

2014-04-02 Thread david
I'd like to introduce stch.ns. What is stch.ns? In short, it's a namespace utility for reloading modified files that's designed to be used in a REPL. Now you may be thinking we already have tools.namespace, so what's the big deal. Here are some differences: 1. Aliased namespaces are preserv

Re: REPL Reloaded

2014-04-02 Thread david
BTW, I'm currently looking for work as a Clojure developer. If you like what you see, please hit me up. David -- 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

Re: [ANN] clj.jdbc 0.1.0-beta5

2014-01-22 Thread david
Looks nice. Thanks for sharing. -- -- 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

Callbacks as Sequences

2013-02-06 Thread david
I'm not to clojure/clojurescript and was wondering if anyone has taken a crack at writing a macro that transforms callbacks into a sequence. There is an awesome implementationion in LispyScript show here: https://gist.github.com/santoshrajan/3715526. Thanks for help. David -- --

Re: Callbacks as Sequences

2013-02-06 Thread david
y 6, 2013 7:45:36 PM UTC+1, da...@dsargeant.comwrote: >> >> I'm not to clojure/clojurescript and was wondering if anyone has taken a >> crack at writing a macro that transforms callbacks into a sequence. There >> is an awesome implementationion in LispyScript show here:

String interpolation in ClojureScript

2013-02-08 Thread david
Why does ClojureScript support string interpolation for js* and not regular clojurescript strings? Interpolation would be very useful. (def x "hi") (js* "alert(~{x});") => "hi" (js/alert "~{x}") => "~{x}" -- -- You received this message because you are subscribed to the Google Groups "Clojur

Re: ANN: ClojureScript release 0.0-1798

2013-05-06 Thread david
Please don't forget to run "lein cljsbuild clean" after upgrading, assuming you're using the cljsbuild lein plugin. Hope this saves someone some valuable time :) David -- -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: Emacs - marmalade package install and .emacs file entries

2011-06-06 Thread David
I'm using GNU Emacs 23.3.1 (i386-mingw-nt6.1.7600) of 2011-03-10 on 3249CTO Here's the relevant section of my init.el (load "package") (add-to-list 'package-archives '("marmalade" . "http://marmalade- repo.org/packages/")) (package-initialize) I've got to load "package" explicitly to prevent a

Re: Enclojure for Clojure 1.2

2010-11-18 Thread David
Have you been able to "Build with Dependencies"? I haven't been able to figure this out yet - though I suspect it's my inexperience with Maven. On Nov 17, 8:28 pm, Ken Wesson wrote: > On Wed, Nov 17, 2010 at 3:54 PM, Harrison Maseko wrote: > > Does Enclojure support Clojure 1.2 yet? > > Yes. I

if-let bug

2011-01-05 Thread David
Consider the two definitions: (defn if-let-good [str] (if-let [rest (seq (drop-while (partial = \a) str))] (first rest) "empty")) (defn if-let-bad [seq] (if-let [rest (seq (drop-while (partial = \a) seq))] (first rest) "empty")) The only difference between them is the name of

Re: if-let bug

2011-01-05 Thread David
Nevermind - it was late, and I found the error message cryptic. Sorry for throwing up a red herring. On Jan 5, 5:30 am, Alessio Stalla wrote: > On Wednesday, January 5, 2011 11:06:34 AM UTC+1, David wrote: > > java.lang.String cannot be cast to clojure.lang.IFn > >

Re: ANN: A simple scheme interpreter in clojure

2011-01-23 Thread David
Line 86 of core.clj is: (list 'cadr caddr) and should be: (list 'caddr caddr) On Jan 23, 9:45 pm, dennis wrote: > I have implemented a simple interpreter in clojure,it is just > transformed from the interpreter in SICP.Maybe someone interested in > it. > > I have pushed it on g

Re: Release.Next Version Number

2011-02-24 Thread David
On Thu, 2011-02-24 at 11:33 -0500, Steve Miner wrote: > The choice boils down to whether or not you want to follow Semantic > Versioning [1]. Apache (APR) [2], Eclipse [3], and OSGi [4] all seem to have > equivalent policies. Personally, I think it's a perfectly logical approach > to increment

Re: Release.Next Version Number

2011-02-24 Thread David
now, it would not be advisable to bump the major version just yet.) That said, I don't have a real problem saying the language itself is 2.0-worthy. David On Thu, 2011-02-24 at 11:45 -0500, Dennis Crenshaw wrote: > What makes an ecosystem '1.x' vs '2.x' etc. needs to be

Re: Readable names

2008-11-12 Thread David
On Nov 10, 3:50 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > > With this in mind it surprises me ( and disappoints a little ) that > > there are still abbreviated function names in many places - aget, > > aset, assoc, conj, coll?, comp, and so on. Is there any need for > > this in the 21st centur

Re: Readable names

2008-11-12 Thread David
a file > and does the opposite when it writes it. On Nov 12, 1:47 pm, Dave Newton <[EMAIL PROTECTED]> wrote: > --- On Wed, 11/12/08, David <[EMAIL PROTECTED]> wrote: > > > You're right. We don't. Not only that. I can't think how aget > > instead of

Re: POLL: Domain name for project hosting site.

2008-11-18 Thread David
I'm not in favour of slangish derivatives. They're good for code- names, but when you get serious, a silly name is an obstacle. First of all, pronunciation descriptors after the name are down-right silly. People start making remarks that you sound like a Wikipedia article. Moreover, it's hard to

Re: Lazy living, without variables

2008-12-02 Thread David Powell
Hi, On the subject of with-local-vars, I noticed that I could use @ to deference them in addition to var-get. Is that intended behaviour? I didn't see it documented anywhere. -- Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: jEdit Mode for Clojure

2008-12-11 Thread David Moss
intermittent ATM. Please let me know if there is anything missing from it or if I can in any way enhance the mode. Kind Regards, David. 2008/12/11 Randall R Schulz > > On Thursday 11 December 2008 10:34, Daniel Spiewak wrote: > > It's been too long since I've looked at this

Re: jEdit Mode for Clojure

2008-12-12 Thread David Moss
so we have the best superset in the editor. Does it sound like a plan? Kind Regards, David. 2008/12/12 Daniel Spiewak > > Which highlighting does it use? > > Daniel > > On Dec 12, 5:10 am, blackdog wrote: > > If anyone on this thread is interested I uploaded clj-jedit

Re: jEdit Mode for Clojure

2008-12-13 Thread David Moss
I've had a really quick look at your mode, it looks good, and I like the regularity in keyword highlighting. I'm going to have a proper look sometime later on the weekend and will get back to you when I have done. Kind Regards, David. 2008/12/12 Daniel Spiewak > > Sounds

Re: jEdit Mode for Clojure

2008-12-15 Thread David Moss
at regexps don't even know about variable substitution. Kind Regards, David. 2008/12/13 David Moss > I've had a really quick look at your mode, it looks good, and I like the > regularity in keyword highlighting. I'm going to have a proper look sometime > later on the weeke

Re: Blogging About Clojure?

2008-12-17 Thread David Nolen
Lots of possibilities, but a simple solution is that you could find a hosting service that supports easy WordPress setup and pick a minimal theme that's to your liking. David On Tue, Dec 16, 2008 at 1:05 PM, Randall R Schulz wrote: > > Hi, > > Wordy though I am, I've n

Re: A quasiquote for Clojure?

2008-12-17 Thread David Nolen
You can have unresolved symbols within a macro with: ~'symbol David On Wed, Dec 17, 2008 at 3:30 AM, Meikel Brandmeyer wrote: > > Hi, > > I'd like to propose/put up for discussion a change to the unquote > handling. > I basically ran into the following problem: >

Re: Blogging About Clojure?

2008-12-20 Thread David Nolen
For syntax highlighting in WordPress this is a good solution<http://wordpress.org/extend/plugins/wp-syntax/>. It was originally written to be used for the EmacsBlog so it should handle Clojure just fine. David On Fri, Dec 19, 2008 at 7:09 PM, Jason wrote: > > Hi Randall, > &g

Re: clojure and clojure-contrib github projects updated

2008-12-27 Thread David Nolen
Thanks! On Sat, Dec 27, 2008 at 2:01 PM, Kevin O'Neill wrote: > Hi all, > I've updated the github svn clones to pull from google code. I've also > pushed the 20081217 branch so it's now accessible from git. > > Any problems please let me know. > > -k. > > > > --~--~-~--~~---

Re: Fibonacci sequence

2008-12-28 Thread David Nolen
tion: (take n collection) Your fib does not produce a collection. David --~--~-~--~~~---~--~~ 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 unsub

Re: why two list comprehensions are different?

2008-12-28 Thread David Nolen
y not realistic (you can't easily implement new Python syntax for yourself), Clojure being a Lisp makes this quite easy. David --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gr

Re: newbie question!!

2009-01-14 Thread David Nolen
(:name @(first (:friends @bill))) You need to dereference before trying to access name. David --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: is it type hint?

2009-01-16 Thread David Nolen
Just made sense to me today as well. #^Class is short form for saying set the metadata for the symbol being defined (in this case list) to the map {:tag Class}. #^ is a reader macro for setting metadata for the compiler. That code is simple tagging the symbol clojure/list. (meta #'list) will g

Inheritance & multiple inheritance using structs

2009-01-18 Thread David Nolen
After a couple of days of hacking it's clear that Clojure can support OO structures really, really, well. I've whipped up a little thing, jokingly called CLJOS. I'm curious to know what people think. It's a fairly simple affair combining structs, hierarchies, and some helper functions. It's my f

Re: Inheritance & multiple inheritance using structs

2009-01-18 Thread David Nolen
Of course it might be the case that not many people are interested in the implementing ideas from CLOS for Clojure especially since there's a lot of exciting new functional ground to cover in Clojure first ;) I come from a UI background so I'm interested in the OO implications/possiblities of Cloj

Re: A couple of questions concerning syntax-quote

2009-01-19 Thread David Nolen
The multiple syntax-quote and unqote behavior above seems to work in Clojure just fine and like CL as well. On Mon, Jan 19, 2009 at 5:58 AM, Rock wrote: > > I'm trying to make the documentation (still awaiting approval) in the > "Learning Clojure" WikiBook regarding syntax-quote expansion as > a

Re: is it type hint?

2009-01-19 Thread David Nolen
Thanks much. On Mon, Jan 19, 2009 at 11:03 AM, Michael Reid wrote: > > On Fri, Jan 16, 2009 at 9:57 PM, David Nolen > wrote: > > Just made sense to me today as well. > > #^Class > > is short form for saying set the metadata for the symbol being defined > (in

#^ Reader Macro Issues was Re: function equivalents of macro characters

2009-01-19 Thread David Nolen
On Mon, Jan 19, 2009 at 12:24 PM, Chouser wrote: > > #^ - metadata > > #^ adds metadata at read-time, so there's no way for a function to do > exactly the same thing, though 'with-meta' does something similar at > runtime. > I've noticed this as well. It seems to me that this prevents you from

Re: #^ Reader Macro Issues was Re: function equivalents of macro characters

2009-01-19 Thread David Nolen
Wow, nice! On Mon, Jan 19, 2009 at 1:47 PM, Stuart Sierra wrote: > > On Jan 19, 1:15 pm, David Nolen wrote: > > I've noticed this as well. It seems to me that this prevents you from > > dynamically defining a var (like in a macro) that has metadata attached > to &g

Re: #^ Reader Macro Issues was Re: function equivalents of macro characters

2009-01-19 Thread David Nolen
Actually, so this can't be used on structs for fns? On Mon, Jan 19, 2009 at 1:47 PM, Stuart Sierra wrote: > > On Jan 19, 1:15 pm, David Nolen wrote: > > I've noticed this as well. It seems to me that this prevents you from > > dynamically defining a var (like i

Re: #^ Reader Macro Issues was Re: function equivalents of macro characters

2009-01-19 Thread David Nolen
Works. amazing. On Mon, Jan 19, 2009 at 4:51 PM, David Nolen wrote: > Actually, so this can't be used on structs for fns? > > On Mon, Jan 19, 2009 at 1:47 PM, Stuart Sierra < > the.stuart.sie...@gmail.com> wrote: > >> >> On Jan 19, 1:15 pm, David Nolen

Re: Possible feature: consider aliases when reading namespace-qualified keywords.

2009-01-19 Thread David Nolen
My OO example from earlier deals with this case by completely removing any need to manually derive tags. This is done by having CLJOS keep it's own internal hierarchy (via make-hierarchy) rather than using the default one. By modifying metadata on the vars holding structs created by defclass (usi

Multimethod Reflection?

2009-01-20 Thread David Nolen
Looking at the multimethod implementation (MultiFn.java) I noticed that multimethod keeps an internal persistent map of dispatch values in a field call methodTable. It seems to me it would pretty simple to expose this field (or a copy of it anyway) so that multimethod reflection can take place. (r

Re: Multimethod Reflection?

2009-01-20 Thread David Nolen
Thanks! On Tue, Jan 20, 2009 at 7:28 PM, Rich Hickey wrote: > > > > On Jan 20, 6:48 pm, David Nolen wrote: > > Looking at the multimethod implementation (MultiFn.java) I noticed that > > multimethod keeps an internal persistent map of dispatch values in a > fiel

Re: struct question

2009-01-22 Thread David Nolen
Finally started a GitHub repo just for this project. http://github.com/swannodette/cljos/tree/master The earlier version of course was very flawed/buggy. OK start, but the macros in it were written with little/no understanding about how symbols are resolved into their namespaces in Clojure (or Li

Re: struct question

2009-01-22 Thread David Nolen
> > I am not entirely happy with this approach though. If everyone starts > to use metadata for various purposes, such type tags may well > disappear by some function replacing the metadata on an object > without preserving the tags that are already there. This is all the > more likely because ther

Re: struct question

2009-01-22 Thread David Nolen
Can't some elements of the problem be solved with some form of predicate dispatching as proposed by Meikel? Predicate dispatching would allows us to use _anything_ as a type (i.e. structs themselves), as well as allowing user defined functions to do the matching instead of being limited to isa? an

Re: struct question

2009-01-22 Thread David Nolen
http://lispnyc.org/soc2009.clp Forget most of what I said, it seems the BDFL already has these things in mind ;) Enough of types and structs for me, time for me dive into the less familiar territory of Clojure. On Thu, Jan 22, 2009 at 12:25 PM, David Nolen wrote: > Can't some element

Re: Possible feature: consider aliases when reading namespace-qualified keywords.

2009-01-23 Thread David Nolen
Nice :) On Fri, Jan 23, 2009 at 2:10 PM, Jason Wolfe wrote: > > On Jan 19, 4:29 pm, Jason Wolfe wrote: > > I've been doing some OO-type Clojure programming, and have run into > > the following (quite minor) annoyance: > > > > I've defined a struct with a :class of ::Foo in namespace > > my.long

Clojure for Games/Simluation/Art (Optimization in Clojure)

2009-01-27 Thread David Nolen
Dear Clojurians, After my obsessed stint with object orientation, I went on to a new obsessed stint with basic functional programming with the hope of converting a nice Java boid simulation written in the popular Processing pedagological tool. I would like to find out if anyone has pointers on im

Re: Clojure for Games/Simluation/Art (Optimization in Clojure)

2009-01-28 Thread David Nolen
> > For the purpose of game development, I think it is a mistake to perform > these calculations for every pair of birds. If you had an error of 1% in > each of the three characteristics (cohesion, alignment, separation) would > that still be good enough? Would this be an acceptable loss if you got

Re: Clojure for Games/Simluation/Art (Optimization in Clojure)

2009-01-28 Thread David Nolen
On Wed, Jan 28, 2009 at 6:59 AM, bOR_ wrote: > > There is many ways in which you can improve the algorithm. I have seen > flocks of 10,000 birds being rendered real-time on a laptop by Hanno > Hildenbrandt, theoretical biology Utrecht. > > > http://www.rug.nl/biologie/onderzoek/onderzoekgroepen/t

Re: pretty-printing?

2009-01-28 Thread David Nolen
Agreed ;) On Wed, Jan 28, 2009 at 9:54 AM, Matt Moriarity wrote: > > I say go for it. maybe swank could use it for macroexpansions and > stuff. the lack of pretty-print drives me crazy! > > On Jan 27, 10:56 am, Mike DeLaurentis wrote: > > Hi, > > > > Is anyone aware of a pretty-print function fo

Re: Object system for Clojure?

2009-01-30 Thread David Nolen
At this point you have to roll your own, I have an experimental thing I plan on fleshing out temporarily called CLJOS. I've implemented field inheritance, type inheritance, basic multiple inheritance, basic introspection. Search the mailing list for CLJOS and you'll see more details. It only took

Re: Object system for Clojure?

2009-01-30 Thread David Nolen
> > (defn make-window [id] > {:tag ::window, :id id}) > > (defn make-color-window [id color] > (assoc (make-window id) >:tag ::color-window >:color color)) > > (derive ::color-window ::window) > > (defmulti describe-window :tag) > > (defmethod describe-window ::window [w] > (println "Win

Re: Object system for Clojure?

2009-01-30 Thread David Nolen
> > On Jan 30, 3:16 pm, Stuart Sierra wrote: > > > > I think the goal is to provide object-like capabilities without > > needing actual objects. > > Why is that the goal? I mean, the JVM provides a well defined, high > performance object oriented system. Clojure can already generate > classes -

Re: Clojure is "not a serious language"

2009-01-30 Thread David Nolen
Agreed :) On Fri, Jan 30, 2009 at 11:40 PM, Jon Harrop wrote: > > > Apologies if you've seen this before but I just thought it was absolutely > hillarious: > > http://www.3ofcoins.net/2009/01/30/common-lisp-clojure-and-seriousness/ > > -- > Dr Jon Harrop, Flying Frog Consultancy Ltd. > http://ww

CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-01 Thread David Nolen
I've changed the name of my project since that was a joke anyway. http://github.com/swannodette/spinoza/tree/master Spinoza isn't just for people who want object oriented behaviors. It's also for anyone who plans on instantiating many structs. Spinoza's make-instance macro automatically orders y

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-02 Thread David Nolen
Just to be clear make-instance is a macro on struct: (defmacro make-instance "Takes a defclassed struct-basis and creates a struct. Initializes properties to default values." [aclass & initializers] (let [class-key (eval (make-pair aclass)) class-sym (symbol (name aclass))

Re: Clojure speed

2009-02-02 Thread David Nolen
Heh, this is a more reasoned reply than my own as it points out an actual implementation difference between Python and Clojure. And of course you might need arbitrary precision arithmetic in your program, but again this just reinforces the insignificance of microbenchmarks without some context of w

Re: Clojure speed

2009-02-02 Thread David Nolen
Please do the list a favor and read the very long threads about performance. You cannot expect to enter a new language run a microbenchmark you would never see in a running programming and expect that to be anything like a real comparison. Here's something unlikely but far less so (something like

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-02 Thread David Nolen
Hey, it is an extremely simplified example ;) Which is more readable in the long run? (struct sprite ::foobar 98 ::hunta ::laser [5.5 3.3] 4.01 78) or (make-instance foobar :id 98 :mode ::hunta :weapon ::laser

Re: special forms vs. functions and macros

2009-02-02 Thread David Nolen
I think the special forms list on the Clojure main page lists all the constructs that are not written in Clojure itself. It seems most everything else can be found in the .clj files in the src directory. I'm constantly looking in there when I'm curious how something works or is implemented, espec

Re: need some help getting jacob com library to work

2009-02-02 Thread David Nolen
You need to add it to -cp argument when starting up the REPL, not your environment CLASSPATH. On Mon, Feb 2, 2009 at 9:05 PM, greg wrote: > > I have recently enjoyed exploring clojure. > > I can use java... > C:\myprograms\clojure>java -cp clojure.jar clojure.lang.Repl > Clojure > user=> (into [

Re: Clojure speed

2009-02-03 Thread David Nolen
Even more constructive is to take a real Python program that you've written where you actually care about it's performance. Rewrite it Clojure. Do some investigation about which parts seem slow to you. Spend some time on this. Come back with some code and questions and you'll probably get some

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-03 Thread David Nolen
: > > On Feb 1, 5:22 pm, David Nolen wrote: > > I've changed the name of my project since that was a joke anyway. > http://github.com/swannodette/spinoza/tree/master > > > > Spinoza isn't just for people who want object oriented behaviors. It's >

Re: Macro error

2009-02-03 Thread David Nolen
{} is a reader macro for hash-map I believe, try something like this: (defmacro foobar [& rest] `(hash-map ~...@rest)) (foobar :first 1 :second 2) On Tue, Feb 3, 2009 at 7:45 PM, Jeffrey Straszheim < straszheimjeff...@gmail.com> wrote: > > Btw, I fixed the ~ needed on relation. It didn't hel

Type hint Java array of your own Java class

2009-02-04 Thread David Nolen
(defn foobar [#^MyClass[] myarray]) This syntax doesn't seem to work. --~--~-~--~~~---~--~~ 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

Re: Type hint Java array of your own Java class

2009-02-04 Thread David Nolen
Many thanks. On Wed, Feb 4, 2009 at 12:49 PM, Christophe Grand wrote: > > David Nolen a écrit : > > (defn foobar [#^MyClass[] myarray]) > > > > This syntax doesn't seem to work. > Indeed it's a bit tricky: > #^"[Lyour.package.YourClass;" > &g

Re: anyone going to FOSDEM?

2009-02-05 Thread David Nolen
two people (including myself) have been playing around with Clojure and wouldn't mind meeting a fellow Clojurian! We arrive on Sunday and are planning on checking FOSDEM out. We're also giving a developer workshop on ShiftSpace in Brussels on the 12th so if you're around come check that out

Clojure Simulation Redux (more on Clojure Optimization)

2009-02-05 Thread David Nolen
t is pretty much a direct translation of the Java version minus mutation, in the next version I hope to incorporate some of the suggestions in reply to my earlier post (FMM in particular). David --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-05 Thread David Nolen
object) ;; returns a list of all the protocols an object implements via multimethod reflection This would be easy to add to Spinoza, if you want perhaps we could hash it out and we can add it. Or you can forge out on your own, but I think it's always fun to join forces. David --~--~---

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-05 Thread David Nolen
(isa? [:spinoza-example-one/circle] [:spinoza/object]) ;; true Just to note, the above shows that protocols could have their own inheritance chain. This is insanely powerful and could be implemented very quickly. --~--~-~--~~~---~--~~ You received this message bec

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-05 Thread David Nolen
> > I'm not looking for a way to statically define protocols in which > classes participate. Consider an example similar to the one I gave in > my reply to Laurent: Static defining of anything is just a matter of chose, especially in Clojure. For example in Spinoza you have pose-as which changes

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-05 Thread David Nolen
> > The fly in the ointment is: what happens if both > protocols specialize frob? Then Clojure will complain that it can't > tell which method to call. In order to resolve that problem, we must > use prefer-method to declare that one protocol or the other is > preferred. > > But what if I want to

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-05 Thread David Nolen
> > (prefer-method frob ::idea ::thing) > (prefer-method [::runtime-tag1 ::idea] [::runtime-tag1 ::thing]) (prefer-method [::runtime-tag2 ::thing] [::runtime-tag2 ::idea]) Provide a dispatch fn that extracts the runtime tag. --~--~-~--~~~---~--~~ You received th

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-05 Thread David Nolen
Have thoughts about this, will have to collect them, will reply soon. On Thu, Feb 5, 2009 at 9:06 PM, mikel wrote: > > > > On Feb 5, 7:12 pm, David Nolen wrote: > > > I'm not looking for a way to statically define protocols in which > > > classes participate.

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-06 Thread David Nolen
> > Yuck. Instead of defining a method on ::idea, you now must define a > method on [something-that-has-no-meaning-in-context ::idea] (because > the dispatch function must now return a vector, which means the > defmethods must now be called on vector dispatch values...). Sure but as you mention

Tools for parsing arguments

2009-02-06 Thread David Nolen
Is there anything in core or contrib for parsing arguments to a function? Since Clojure fns don't support optional args or even keyword args, is there a standard set of helpers functions to do this? I looked around but I didn't see anything obvi

  1   2   3   4   5   6   7   8   9   10   >