Whilst you solved your problem, you didn't get an answer about metadata.
There are multiple places metadata can appear in a function definition:
dev=> (defn ^{:one true} func (^{:two true} [x] {:three true} x) {:four
true})
#'dev/func
dev=> (meta #'func)
{:one true, :argli
Hmmm, okay, I was using slingshot/try+ everywhere and then, just once, I
used a plain 'try' and forgot to use the correct catch. My fault.
On Thursday, February 3, 2022 at 1:56:59 PM UTC-5 Laws wrote:
>
> I see this old post by Fogus:
>
> http://blog.fogus.me/2009/12/21/clojures-pre-and-post/
>
I see this old post by Fogus:
http://blog.fogus.me/2009/12/21/clojures-pre-and-post/
With this example:
(defn constrained–fn [f x]
{:pre [(pos? x)]
:post [(= % (* 2 x))]}
(f x))
But I see this modern example:
https://ostash.dev/posts/2021-07-01-pre-post-conditions/
(defn func ^{:pre
Yes, you would need to actually create a spec implementation to improve the
error message in this case.
We haven't ever talked about spec'ing meta. In one sense I'd say the
general philosophy in Clojure is that meta is *not* part of the data (as in
how equality ignores meta), an
Thanks Alex. But then
(s/assert ::o {})
gives
failed: (valid? ::meta-spec (meta %))
which is not quite satisfactory.
Is my understanding correct that for a more integrated approach one would need a
custom Spec implementation? And if so, shouldn't it be part of the core then?
(s/def ::o #(s/valid? ::meta-spec (meta %)))
should work.
On Saturday, October 21, 2017 at 3:57:20 PM UTC-5, Vitalie Spinu wrote:
>
>
> Hi,
>
> If my meta spec looks like
>
> (s/def ::meta-spec (s/keys :req [::xyz]))
>
>
> how do I define a spec for objects
Hi,
If my meta spec looks like
(s/def ::meta-spec (s/keys :req [::xyz]))
how do I define a spec for objects whose meta conforms to `::meta-spec`?
Thanks!
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, sen
On Friday, October 13, 2017 at 2:55:51 PM UTC-4, Justin Smith wrote:
>
> what happens is that the metadata reader macro is applied before the
> comment reader macro, so you comment out the name of the def (which also
> had the metadata attached)
>
> user=> '(def #_ ^:private foo 1)
> (def 1)
>
what happens is that the metadata reader macro is applied before the
comment reader macro, so you comment out the name of the def (which also
had the metadata attached)
user=> '(def #_ ^:private foo 1)
(def 1)
On Fri, Oct 13, 2017 at 11:48 AM Rob Nikander
wrote:
> Hi,
>
> Why doesn't this compi
Hi,
Why doesn't this compile? I tried to comment out the "private" metadata.
(def #_^:private foo 1)
CompilerException java.lang.RuntimeException: First argument to def must
be a Symbol, compiling:(null:1:1)
Rob
--
You received this message because you are subscribed to the Google
Grou
I'll do you one better... instead of having a convention for the value of
the :deprecated key, use a map so you can have information such as the
version in which it was deprecated, planned removal version, alternatives
and soforth.
On Thursday, August 11, 2016 at 1:54:08 AM UTC-7, Matt Mower wr
On Wednesday, 10 August 2016 13:22:47 UTC+1, Alex Miller wrote:
> In this case, there is not a specific function to point to, rather the use
> of a transducer with a chan is the alternative.
How about {:deprecated } where the URL could refer to a
human-readable/machine-processable description
In this case, there is not a specific function to point to, rather the use of a
transducer with a chan is the alternative.
--
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 f
Thanks! The Meta-data message may address to alternative function.
Such as: {:deprecated "0.1.319.0-6b1aca-alpha - Please use x function
instead"}
On Wednesday, August 10, 2016 at 12:01:10 AM UTC+3, Alex Miller wrote:
>
> I've added the :deprecated metadata to c
e:
>>
>> I found the *map>* function from *core.async* and it was deprecated(doc
>> says), but there is no meta-data.
>>
>> If we have meta-data for *deprecated* functions our tools(IDEs) would
>> work better, like scratch out the function(Most IDEs do that).
>>
>>> I found the *map>* function from *core.async* and it was deprecated(doc
>>> says), but there is no meta-data.
>>>
>>> If we have meta-data for *deprecated* functions our tools(IDEs) would
>>> work better, like scratch out the funct
etin wrote:
>>
>> I found the *map>* function from *core.async* and it was deprecated(doc
>> says), but there is no meta-data.
>>
>> If we have meta-data for *deprecated* functions our tools(IDEs) would
>> work better, like scratch out the function(Most IDE
through to completion for Clojure 1.9.
See: http://dev.clojure.org/jira/browse/CLJ-706
On Tuesday, August 9, 2016 at 3:05:24 PM UTC-5, Ertuğrul Çetin wrote:
>
> I found the *map>* function from *core.async* and it was deprecated(doc
> says), but there is no meta-data.
>
> If we ha
I found the *map>* function from *core.async* and it was deprecated(doc
says), but there is no meta-data.
If we have meta-data for *deprecated* functions our tools(IDEs) would work
better, like scratch out the function(Most IDEs do that).
Ex:
This
(defn map>
"."
We've been here before with Fluid Dynamics. The whole rational
explanation/discussion thing didn't work last time, and probably won't
this time.
I'd suggest ending this thread immediately.
Timothy Baldridge writes:
> To expand my previous reply. What site are you talking about? I got your
> em
To expand my previous reply. What site are you talking about? I got your
email via my email client (Gmail) so what are you talking about?
And if you are talking about the Google Groups website, perhaps contact
them? This is completely the wrong place to complain about how your browser
reacts to so
lol, wut?
On Thu, Oct 8, 2015 at 9:06 AM, Fluid Dynamics wrote:
> I don't know what you guys did, but as of about 2 days ago, when browsing
> this site about 1 time in 20 after reading an article and then clicking
> "back" to go back to the topic list my main Firefox window disappears and
> is r
I don't know what you guys did, but as of about 2 days ago, when browsing
this site about 1 time in 20 after reading an article and then clicking
"back" to go back to the topic list my main Firefox window disappears and
is replaced by a small dialog with two options, "restart Firefox" and "quit
The site is working fine for me.
In case it's helpful, I have had trouble loading Google sites in the past
when I have inadvertently left my iPhone's personal hotspot turned on while
my computer is connected to both my phone and my home network. The multiple
routes seem to confuse Google's ability
I'm frequently seeing my browser get stuck at "Transferring data from
groups.google.com" and then failing to progress further, when refreshing
the topic list. This has been going on intermittently, but frequently, for
several days now.
Is anyone else seeing this? What is the fix?
--
You recei
I recently posted in mistake and deleted the post. Perhaps that is causing what
you are seeing.
- Mike
> On Aug 4, 2015, at 10:09 AM, Fluid Dynamics wrote:
>
> The front page of this group shows no unread threads to me, but shows a (1)
> next to "Google Groups" in the page title. So there's o
The front page of this group shows no unread threads to me, but shows a (1)
next to "Google Groups" in the page title. So there's one topic with unread
posts, but I can't get the interface to show it to me. I've tried refresh,
shift-refresh, and navigate-away-and-back. I'm sure I haven't done an
, 2015 at 10:00:59 AM UTC-4, Sarkis Karayan wrote:
>
>
> Why doesn't this work?
> user=> (meta ^{:some-meta 123} 'n)
> nil
>
> While this works:
> user=> (meta ^{:some-meta 123} (fn [n] n))
> {:some-meta 123}
>
> And this works too:
> user=> (
to get the meta-data of a var (I'm guessing symbol n refers to a var...)
you should call it on the var iself, not its value or symbol:
user=> (def ^{:some-meta 123} n 0)
#'user/n
user=> (meta n)
nil
user=> (meta 'n)
nil
user=> (meta #'n)
{:some-meta 123, :ns #
Why doesn't this work?
user=> (meta ^{:some-meta 123} 'n)
nil
While this works:
user=> (meta ^{:some-meta 123} (fn [n] n))
{:some-meta 123}
And this works too:
user=> (meta (with-meta 'n {:some-meta 123}))
{:some-meta 123}
Is this intended behavior? If so, what&
Hi Christopher,
I recommend still sending a proposal for Alex's project just in case. It's
hard to predict
what constraints we will need to satisfy for project allocation (we might
have a small number
of allocations from Google, a student may choose a project with another
organisation).
Thanks,
A
On Friday, March 20, 2015 at 12:06:34 AM UTC+1, Alex Miller wrote:
>
> Chris (and anyone else), Daniel mentioned to me in a note that it is ok
> for multiple students to submit a proposal for the same project. We do not
> know how many spots we will be given as an organization and whether
> part
Chris (and anyone else), Daniel mentioned to me in a note that it is ok for
multiple students to submit a proposal for the same project. We do not know
how many spots we will be given as an organization and whether particular
students will meet whatever guidelines are set out by Google. So I thi
Found var-link kicking around in my projects dir so I re-published it for
this thread.
https://github.com/clojure-grimoire/var-link
Reid
--
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
N
Hello! Alex decided to proceed with Richard. Therefore, I'd like to find
some
other project. I'm glad to see so much feedback and I'd really like to
reply to
all your feedback but there is not much time to the end of application
period
and therefore I will focus exclusively on the another projec
Am Mittwoch, 18. März 2015 07:18:30 UTC+1 schrieb Reid McKenzie:
>
> Alex, glad to see we're on the same wavelength about this more or less.
>
> Christopher, some other deliverables worth considering:
>
Hi all, so I'm the other student Alex mentioned. I'm not participating so
much in this dis
Alex, glad to see we're on the same wavelength about this more or less.
Christopher, some other deliverables worth considering:
- What format is documentation in? As Grimoire is evidence, plain doc
text is pretty badly formatted on average certainly in comparison to
HTML or even markdown.
I'm answering these out of order, sorry. :)
On Tuesday, March 17, 2015 at 12:40:53 AM UTC-5, Reid McKenzie wrote:
>
> Hey Christopher,
>
> I'm Reid, the Grimoire maintainer.
> I'm delighted to see that someone besides myself and Alex is interested in
> this project and I wish you the best in your
Hey all,
Responding here to several things from both Reid and Francesco. I wanted to
step back slightly to set some context. I proposed the project that Chris
has posted and some of the points that Reid brought up are really source
from my proposal so I wanted to take the blame as it were for
Hi Christopher,
I'm Francesco, the maintainer of crossclj.info
I think it's a very interesting project. Some comments on your proposal:
1) I think the information model is by far most important deliverable. I
agree with Reid that a sound "coordinate system" is very important
2) The toolchain y
Hey Christopher,
I'm Reid, the Grimoire maintainer.
I'm delighted to see that someone besides myself and Alex is interested in
this project and I wish you the best in your GSoC application.
I'm somewhat concerned in reading your proposal that while you claim the
proposed data structure represen
Tom lovingly maintains autodoc and the Clojure projects' automated doc
generation with it. But it mostly just continues doing what it does.
--
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
istopher Medrela and I'd like to work at "source
> metadata
> information model" project mentored by Alex Miller at Google Summer of
> Code. I
> hope that this mailing list is the right place to discuss such projects
> (if I'm
> wrong, correct me).
>
>
27;m
> wrong, correct me).
>
> I'd like to introduce some standard of source meta information model to
> represent the code from the API perspective. There exist a lot of tools
> like
> codox, autodoc, Grimoire, ClojureDocs, crosscls.info and so on. Each of
> these
>
o introduce some standard of source meta information model to
represent the code from the API perspective. There exist a lot of tools like
codox, autodoc, Grimoire, ClojureDocs, crosscls.info and so on. Each of
these
tools has some repetitive code responsible for extracting this kind of
informat
ass it and add an IObj implementation. (Note that most,
>> maybe all clojure ways of creating classes create final classes, so this
>> technique won't work.) The easiest way to subclass is with `proxy`:
>>
>> (defn meta-AtomHolder [atom-value metadata]
>> (pro
> Other than that, it can be anything. A Java class, or a type or a
>>> record...
>>>
>>>
>>>
>>>>
>>>>
>>>> If you can control the construction of this object and its class is not
>>>> final, you can subcl
r a type or a
>> record...
>>
>>
>>
>>>
>>>
>>> If you can control the construction of this object and its class is not
>>> final, you can subclass it and add an IObj implementation. (Note that most,
>>> maybe all clojure way
his object and its class is not
>> final, you can subclass it and add an IObj implementation. (Note that most,
>> maybe all clojure ways of creating classes create final classes, so this
>> technique won't work.) The easiest way to subclass is with `proxy`:
>>
n subclass it and add an IObj implementation. (Note that most,
> maybe all clojure ways of creating classes create final classes, so this
> technique won't work.) The easiest way to subclass is with `proxy`:
>
> (defn meta-AtomHolder [atom-value metadata]
> (proxy [AtomHolderClass cl
Can you monkey-patch the meta function itself to draw from a map of object
to meta?
On Saturday, August 30, 2014, Francis Avila wrote:
> It would probably help if you said more about the source of this
> atom-holding object. Is it a plain Java class? A deftype/defrecord? Is it
> final?
,
maybe all clojure ways of creating classes create final classes, so this
technique won't work.) The easiest way to subclass is with `proxy`:
(defn meta-AtomHolder [atom-value metadata]
(proxy [AtomHolderClass clojure.lang.IObj] ;; [superclass, new interfaces]
[atom-
I can't really pass a list since the first function is expecting the
> object I am passing, then it calls some other functions that were supposed
> to extract the meta. The problem is, functions that are called later can be
> executed in a different thread.
>
>
>
> On S
Hi François,
Thanks for the links.
I can't really pass a list since the first function is expecting the object
I am passing, then it calls some other functions that were supposed to
extract the meta. The problem is, functions that are called later can be
executed in a different thread.
O
On 30/08/14 05:15, Atamert Ölçgen wrote:
Obviously I can't.
But I need to add this capability to an object. During testing I
attach meta to this object that contains an atom. Then I pass this
object to other functions, known in runtime. I can't use a dynamic var
because all th
Obviously I can't.
But I need to add this capability to an object. During testing I attach
meta to this object that contains an atom. Then I pass this object to other
functions, known in runtime. I can't use a dynamic var because all this
happens within a mock function that may be retri
> Good stuff, all the hard work you've done in the field of live coding,
> yet no mention of Meta-ex nor clojure in the Computer Music Journal which
> has a whole issue dedicated to this subject ;(
>
> To be honest, Overtone was never targeted at academics. It was built
On 10 Apr 2014, at 03:18, Earl Jenkins wrote:
> Good stuff, all the hard work you've done in the field of live coding, yet no
> mention of Meta-ex nor clojure in the Computer Music Journal which has a
> whole issue dedicated to this subject ;(
To be honest, Overtone was nev
Good stuff, all the hard work you've done in the field of live coding, yet
no mention of Meta-ex nor clojure in the Computer Music Journal which has a
whole issue dedicated to this subject ;(
of course this is just from me scanning the issue.
keep up the inspiring work
I'll soon brus
For those that enjoyed the interview and are interested in how we sound this
month, we just pushed out a new track, lovingly live coded in Clojure:
https://soundcloud.com/meta-ex/spiked-with-recursive-dreams
Sam
---
http://sam.aaron.name
On 2 Apr 2014, at 21:33, Samuel Aaron wrote:
> Ho
Howdy there Clojuristaritorians!
For those of you that enjoy seeing applications of code in none-business
contexts, you might be excited to see Clojure being mentioned in Imperica - a
Digital Arts & Culture Magazine:
http://www.imperica.com/en/in-conversation-with/meta-ex-the-music-of-
2014-02-13 1:05 GMT+08:00 Herwig Hochleitner :
> 2014-02-12 5:36 GMT+01:00 Di Xu :
>
>>
>> all lisp dialect provide `read` function, so if you want to build an
>> evaluator, you could just use this function and don't need to do lexical
>> and syntax analysis.
>>
>
> Maybe your understanding of th
2014-02-12 5:36 GMT+01:00 Di Xu :
>
> all lisp dialect provide `read` function, so if you want to build an
> evaluator, you could just use this function and don't need to do lexical
> and syntax analysis.
>
Maybe your understanding of these terms is different from mine, in my view:
A lisp evalua
2014-02-12 5:18 GMT+01:00 t x :
>
> If no such evaluator exists, where is the complexity of a
> clojure-in-clojure evaluator that I failed to mention above?
>
Clojure is a compiled language. This means that even if you leave out any
platform issues like bytecode generation, there is still an an
s the
power of lisp, so I can't see why you can't do it. The difficult part is
adding core library support, this will take a lot of time and code to
implement.
2014-02-12 12:18 GMT+08:00 t x :
> Hi,
>
> With apologies for a soft question:
>
> * in SICP, the meta c
Hi,
With apologies for a soft question:
* in SICP, the meta circular evaluator of scheme in scheme (chapter
4) is about a page
* in Ansi Common Lisp, there's a lisp in lisp in about half a page
* if we took Clojure, and ripped out all the JVM support (i.e.
gen-class, proxy, (.jav
On 16 Dec 2013, at 22:48, Timothy Washington wrote:
> Lol, very cool :)
Haha, thanks. The best is definitely still to come though. 2014 should be a
good year for Meta-eX and live coding with Clojure.
Sam
---
http://sam.aaron.name
--
--
You received this message because you
Lol, very cool :)
Tim Washington
Interruptsoftware.ca <http://interruptsoftware.ca>
On Mon, Dec 16, 2013 at 6:41 AM, Samuel Aaron wrote:
> Hey everyone,
>
> just a quick promotional email, so I'll keep it brief.
>
> Meta-eX[1] just pushed a small excerpt
On Mon, Dec 16, 2013 at 6:41 AM, Samuel Aaron wrote:
> just a quick promotional email, so I'll keep it brief.
>
> Meta-eX[1] just pushed a small excerpt from a recent Live Session featuring
> the voice of Rich Hickey:
>
> https://soundcloud.com/meta-ex/power-to-complect
Hey everyone,
just a quick promotional email, so I'll keep it brief.
Meta-eX[1] just pushed a small excerpt from a recent Live Session featuring the
voice of Rich Hickey:
https://soundcloud.com/meta-ex/power-to-complect
It's not every day you get to hear music coded and performed wi
Wood writes:
> Just s guess: Maybe the classpath is absolute in one case and relative in
> the other.
>
> On 07 Nov 2013 7:15 PM, "Phillip Lord" wrote:
>>
>>
>> I find myself confused by the metadata on a var. Consider this code:
>>
>> (def a-test
Just s guess: Maybe the classpath is absolute in one case and relative in
the other.
On 07 Nov 2013 7:15 PM, "Phillip Lord" wrote:
>
>
> I find myself confused by the metadata on a var. Consider this code:
>
> (def a-test-var 10)
>
> (pritnln (meta #'a-tes
I find myself confused by the metadata on a var. Consider this code:
(def a-test-var 10)
(pritnln (meta #'a-test-var))
Now when run under "lein test" (by stuffing it into a test namespace), I
get this
{:ns #, :name a-test-var, :column 1, :line 102,
:file tawny/util_test.c
The with-meta in (fn ^:static with-meta ...) is just the name the
function created by the fn form will know itself by. It will also be
used as the final segment of the name of the class of this function
object. It's not being evaluated in this position, and in fact it
could be replaced with
You are right, i noticed "it calls withMeta", but in the expression,
actually use with-meta to define with-meta, it's very strange, thank you
very much!
(def with-meta (fn ^:static with-meta [^clojure.lang.IObj x m]
(. x (withMeta m
On Saturday, Septe
Actually with-meta's definition does not refer to with-meta. Rather,
it calls withMeta, a method in the clojure.lang.IObj interface which
the first argument to with-meta is supposed to implement.
Cheers,
Michał
On 21 September 2013 09:01, wrote:
> Hi,
> I read the source abou
Hi,
I read the source about with-meta, and find def with-meta using
with-meta, can it? someone give a explain?
user=> (source with-meta)
(def
^{:arglists '([^clojure.lang.IObj obj m])
:doc "Returns an object of the same type and value as obj, with
map m as its metadat
doing with
> Clojure and Overtone within the music space. I gave a talk at a music tech
> conference in London a good few months ago and they just put the video
> online:
>
> https://www.youtube.com/watch?v=zJqH5bNcIN0
>
> It's a pretty good description of the kinds of thin
N0
It's a pretty good description of the kinds of things we do (as Meta-eX) and a
demonstration of the power of Clojure for making and manipulating music live in
front of an audience. We also put a different spin on the notion of performance
testing of our software ;-)
The great thing about
Karsten Schmidt writes:
> Sinc the prefix map is built iteratively as part of the parsing I was
> hoping to attach it as meta data to the returned lazy-seq, since I
> can't see any other way of returning this map apart from attaching to
> every single triple in the seq (which se
["http://example.org/ns#clojure"; "http://usefulinc.com/ns/doap#name";
"Clojure"])
Sinc the prefix map is built iteratively as part of the parsing I was
hoping to attach it as meta data to the returned lazy-seq, since I
can't see any other way of returning this map
Hello, what is the correct way (assuming there is one) to create a lazy-seq
with metadata attached? The below works for short seqs, but causes a stack
overflow for large ones, which obviously means the lazy-seq mechanism is
altered/broken if wrapped with `with-meta`. So I guess there must be
The goal is to have an extensible, simple core for a testing lib, where all
other Clojure testing libs can be rewritten as extensions to it.
A common motivation is that people want to mix and match aspects/features
of different testing lib. But really, each person wants this for different
reasons.
mposition in the new O'Reilly lecture series "Clojure Inside Out".
>>
>> However, that's just warm-up material...
>>
>> Come and jump aboard the M.S. Stubnitz and witness Meta-eX blow your mind
>> with some seriously loud hand-hacked beats. Meta-eX i
warm-up material...
Come and jump aboard the M.S. Stubnitz and witness Meta-eX blow your mind with
some seriously loud hand-hacked beats. Meta-eX is the only Clojure-powered band
on Earth, and we hack live in Emacs using Overtone to weave immutable data
structures into ephemeral sounds.
&quo
On Wednesday, January 9, 2013 4:23:06 PM UTC-5, Jim foo.bar wrote:
> hehehe...I'm really stupid aren't I?:-[
>
Not at all. :) It takes time to get used to all the different ways things
can be used, for example the fact that records support metadata.
-S
--
--
You received this message beca
hehehe...I'm really stupid aren't I?:-[
thanks Stuart...
Jim
On 09/01/13 21:11, Stuart Sierra wrote:
You could also do:
(defrecord MString [string])
-S
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@g
You could also do:
(defrecord MString [string])
-S
--
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
Hi all,
I often find myself wanting to attach meta-data to built-in Java classes
and particularly to the 'String' class. In a text-mining and NLP
context, it is very useful for example to have a dictionary of strings
where each string 'knows' its synonyms...Of course one
When you compare functions, it only checks if it is the same function
object (not if the function "behaves" the same way).
For example:
(= (fn []) (fn []))
;=> false
The reason you get false in your case is because with-meta returns a new
object every time you call it.
We need a
Hi,
only for persistent data structures (with a few caveats) [1]. For other
objects, such as function objects, equality check falls back to .equals().
Since with-meta returns a new object instance of an anonymous class,
.equals will always be false.
[1]
https://github.com/clojure/clojure/blob
I have unexplained behavior for with-meta.
As far as I understand with-meta should not alter object identity. E.g. if
we have the (= a b) => true for some a and b then
(= (with-meta a ma) (with-meta b mb)) => true should also hold for any ma
and mb.
So why do I get the following behav
s
> pointing to the function. You can see this in the following (#' is a
> shorthand to get the var rather than the thing it contains).
>
> user=> (meta f1)
> nil
> user=> (meta #'f1)
> {:arglists ([]), :ns #, :test true, :name f1, :line 1,
> :source &quo
Hey Mamun,
Your problem is that your ^{:test true} metadata isn't being applied
to your functions, as you might expect, but rather to the var that is
pointing to the function. You can see this in the following (#' is a
shorthand to get the var rather than the thing it contains).
user=
Direct copy-paste from my repl:
user=> (defn ^{:test true} f1 []
#_=> (println "call f1 fn"))
#'user/f1
user=>
user=> (defn ^{:test false} f2 []
#_=> (println "call f2 fn"))
#'user/f2
user=> (:test (meta (var f1)))
true
user=> (
t true} f1 []
(println "call f1 fn"))
(defn ^{:test false} f2 []
(println "call f2 fn"))
(def f* (list f1 f2))
(defn process [form]
(do
(form) ; it will call f1, f2...
;I need to access meta data of f1, f2..
* ;(println (:test (meta (var form ;Error
well not quite!
you need (-> form
var
meta
:test)
or the same thing written differently (:test (meta (var form)))
Hope that helps,
Jim
ps: basically the meta-data sit with the var not the function
On 22/10/12 16:33,
If I've understood correctly all you need is (meta form)...
Jim
On 22/10/12 15:30, Mamun wrote:
Hi All,
I've a application with following structure. Now I would like to
access meta data of f1 and f2 within process function.
(defn ^{:test true} f1 []
(println "call
Hi All,
I've a application with following structure. Now I would like to access
meta data of f1 and f2 within process function.
(defn ^{:test true} f1 []
(println "call f1 fn"))
(defn ^{:test false} f2 []
(println "call f2 fn"))
(def f* (list f1 f2))
(
I am sorry, You are correct. I see what you mean. I mis-interpreted meta()
as returning an empty meta-map.
On Sunday, July 29, 2012 10:26:46 AM UTC+2, Per Mildner wrote:
>
> Thanks, but the question was not about the empty() methods.
>
> On Sunday, July 29, 2012 4:14:09 AM UTC+2,
1 - 100 of 278 matches
Mail list logo