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
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
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
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
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
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
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
: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
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
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)
(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
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 -
"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
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
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
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
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
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
-
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
(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
.
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
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
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
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'
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
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
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
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
--
--
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:
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
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"
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
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
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
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
> >
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
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
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
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
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
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
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
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
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
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
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
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
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:
>
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
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.
>
> >
>
--~--~-~--~~---
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
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
(: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
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
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
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
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
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
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
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
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
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
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
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
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
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
>
> 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
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
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
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
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
>
> 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
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
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
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
>
> (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
>
> 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 -
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
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
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))
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
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
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
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
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 [
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
:
>
> 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
>
{} 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
(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
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
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
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
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
--~--~---
(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
>
> 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
>
> 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
>
> (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
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.
>
> 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
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 - 100 of 3254 matches
Mail list logo