Re: pre and post assertions, always in the meta data?

2022-02-15 Thread Sean Corfield
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

Re: pre and post assertions, always in the meta data?

2022-02-03 Thread Laws
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/ >

pre and post assertions, always in the meta data?

2022-02-03 Thread Laws
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

Re: How to spec meta?

2017-10-24 Thread Alex Miller
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

Re: How to spec meta?

2017-10-24 Thread Vitalie Spinu
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?

Re: How to spec meta?

2017-10-24 Thread Alex Miller
(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

How to spec meta?

2017-10-21 Thread Vitalie Spinu
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

Re: form comment and meta data?

2017-10-13 Thread Rob Nikander
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) >

Re: form comment and meta data?

2017-10-13 Thread Justin Smith
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

form comment and meta data?

2017-10-13 Thread Rob Nikander
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

Re: Meta-data should be added to deprecated functions?

2016-08-11 Thread Reid McKenzie
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

Re: Meta-data should be added to deprecated functions?

2016-08-11 Thread Matt Mower
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

Re: Meta-data should be added to deprecated functions?

2016-08-10 Thread Alex Miller
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

Re: Meta-data should be added to deprecated functions?

2016-08-09 Thread Ertuğrul Çetin
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

Re: Meta-data should be added to deprecated functions?

2016-08-09 Thread Dan Burton
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). >>

Re: Meta-data should be added to deprecated functions?

2016-08-09 Thread Alex Miller
>>> 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

Re: Meta-data should be added to deprecated functions?

2016-08-09 Thread Ertuğrul Çetin
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

Re: Meta-data should be added to deprecated functions?

2016-08-09 Thread Alex Miller
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

Meta-data should be added to deprecated functions?

2016-08-09 Thread Ertuğrul Çetin
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> "."

Re: [meta] Unwelcome changes around here.

2015-10-08 Thread Phillip Lord
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

Re: [meta] Unwelcome changes around here.

2015-10-08 Thread Timothy Baldridge
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

Re: [meta] Unwelcome changes around here.

2015-10-08 Thread Timothy Baldridge
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

[meta] Unwelcome changes around here.

2015-10-08 Thread Fluid Dynamics
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

Re: [Meta] Anyone else having trouble with this site recently?

2015-08-25 Thread Chad Harrington
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

[Meta] Anyone else having trouble with this site recently?

2015-08-24 Thread Fluid Dynamics
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

Re: [meta] Can't view one unread topic here.

2015-08-04 Thread Mike Fikes
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

[meta] Can't view one unread topic here.

2015-08-04 Thread Fluid Dynamics
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

Re: Is this expected behavior with meta data?

2015-06-25 Thread Andy-
, 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=> (

Re: Is this expected behavior with meta data?

2015-06-25 Thread gianluca torta
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 #

Is this expected behavior with meta data?

2015-06-25 Thread Sarkis Karayan
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&

Re: [GSoC] Source meta information model proposal

2015-03-20 Thread Ambrose Bonnaire-Sergeant
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

Re: [GSoC] Source meta information model proposal

2015-03-20 Thread Christopher Medrela
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

Re: [GSoC] Source meta information model proposal

2015-03-19 Thread Alex Miller
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

Re: [GSoC] Source meta information model proposal

2015-03-19 Thread Reid McKenzie
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

Re: [GSoC] Source meta information model proposal

2015-03-18 Thread Christopher Medrela
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

Re: [GSoC] Source meta information model proposal

2015-03-18 Thread richard . moehn
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

Re: [GSoC] Source meta information model proposal

2015-03-17 Thread Reid McKenzie
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.

Re: [GSoC] Source meta information model proposal

2015-03-17 Thread Alex Miller
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

Re: [GSoC] Source meta information model proposal

2015-03-17 Thread Alex Miller
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

Re: [GSoC] Source meta information model proposal

2015-03-17 Thread Francesco Bellomi
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

Re: [GSoC] Source meta information model proposal

2015-03-16 Thread Reid McKenzie
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

Re: [GSoC] Source meta information model proposal

2015-03-16 Thread Alex Miller
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

Re: [GSoC] Source meta information model proposal

2015-03-16 Thread Andy Fingerhut
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). > >

Re: [GSoC] Source meta information model proposal

2015-03-16 Thread Francis Avila
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 >

[GSoC] Source meta information model proposal

2015-03-16 Thread Christopher Medrela
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

Re: How can I add meta to an object that doesn't implement IObj?

2014-09-01 Thread James Reeves
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

Re: How can I add meta to an object that doesn't implement IObj?

2014-09-01 Thread adrian . medina
> 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

Re: How can I add meta to an object that doesn't implement IObj?

2014-08-31 Thread Atamert Ölçgen
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

Re: How can I add meta to an object that doesn't implement IObj?

2014-08-31 Thread adrian . medina
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`: >>

Re: How can I add meta to an object that doesn't implement IObj?

2014-08-31 Thread Atamert Ölçgen
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

Re: How can I add meta to an object that doesn't implement IObj?

2014-08-30 Thread Gary Trakhman
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?

Re: How can I add meta to an object that doesn't implement IObj?

2014-08-30 Thread Francis Avila
, 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-

Re: How can I add meta to an object that doesn't implement IObj?

2014-08-30 Thread Alex Baranosky
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

Re: How can I add meta to an object that doesn't implement IObj?

2014-08-30 Thread Atamert Ölçgen
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

Re: How can I add meta to an object that doesn't implement IObj?

2014-08-30 Thread François Rey
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

How can I add meta to an object that doesn't implement IObj?

2014-08-29 Thread Atamert Ölçgen
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

Re: Meta-eX - The Music of Code

2014-04-14 Thread Islon Scherer
> 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

Re: Meta-eX - The Music of Code

2014-04-11 Thread Samuel Aaron
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

Re: Meta-eX - The Music of Code

2014-04-09 Thread Earl Jenkins
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

Re: Meta-eX - The Music of Code

2014-04-09 Thread Samuel Aaron
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

Meta-eX - The Music of Code

2014-04-02 Thread Samuel Aaron
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-

Re: meta circular clojure

2014-02-13 Thread Di Xu
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

Re: meta circular clojure

2014-02-12 Thread 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 these terms is different from mine, in my view: A lisp evalua

Re: meta circular clojure

2014-02-12 Thread Herwig Hochleitner
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

Re: meta circular clojure

2014-02-11 Thread Di Xu
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

meta circular clojure

2014-02-11 Thread t x
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

Re: Meta-eX: Power to Complect (featuring Rich Hickey)

2013-12-17 Thread Samuel Aaron
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

Re: Meta-eX: Power to Complect (featuring Rich Hickey)

2013-12-16 Thread Timothy Washington
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

Re: Meta-eX: Power to Complect (featuring Rich Hickey)

2013-12-16 Thread Tim Visher
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

Meta-eX: Power to Complect (featuring Rich Hickey)

2013-12-16 Thread Samuel Aaron
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

Re: confused over meta on var

2013-11-08 Thread Phillip Lord
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

Re: confused over meta on var

2013-11-07 Thread Michael Wood
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

confused over meta on var

2013-11-07 Thread Phillip Lord
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

Re: About with-meta source, can explain it by itself?

2013-09-21 Thread Michał Marczyk
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

Re: About with-meta source, can explain it by itself?

2013-09-21 Thread ljcppunix
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

Re: About with-meta source, can explain it by itself?

2013-09-21 Thread Michał Marczyk
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

About with-meta source, can explain it by itself?

2013-09-21 Thread ljcppunix
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

Re: Making Music with Clojure: Meta-eX

2013-08-08 Thread John D. Hume
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

Making Music with Clojure: Meta-eX

2013-08-08 Thread Sam Aaron
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

Re: lazy-seq with meta

2013-07-14 Thread Tassilo Horn
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

Re: lazy-seq with meta

2013-07-12 Thread Karsten Schmidt
["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

lazy-seq with meta

2013-07-12 Thread Karsten Schmidt
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

Feedback request: Spec for meta testing-lib

2013-06-17 Thread Steven Degutis
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.

Re: Meta-eX: Hacking Overtone on the Stubnitz - Thurs 16th May

2013-05-14 Thread Chris Ford
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

Meta-eX: Hacking Overtone on the Stubnitz - Thurs 16th May

2013-05-13 Thread Sam Aaron
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

Re: String wrapper that supports meta-data...

2013-01-27 Thread Stuart Sierra
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

Re: String wrapper that supports meta-data...

2013-01-09 Thread Jim - FooBar();
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

Re: String wrapper that supports meta-data...

2013-01-09 Thread Stuart Sierra
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

String wrapper that supports meta-data...

2013-01-09 Thread Jim foo.bar
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

Re: Object identity and with-meta

2012-11-23 Thread Jonathan Fischer Friberg
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

Re: Object identity and with-meta

2012-11-23 Thread László Török
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

Object identity and with-meta

2012-11-23 Thread N8Dawgrr
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

Re: Meta data access

2012-10-23 Thread Mamun
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

Re: Meta data access

2012-10-22 Thread Carlo Zancanaro
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=

Re: Meta data access

2012-10-22 Thread Jim - FooBar();
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=> (

Re: Meta data access

2012-10-22 Thread Mamun
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

Re: Meta data access

2012-10-22 Thread Jim foo.bar
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,

Re: Meta data access

2012-10-22 Thread Jim foo.bar
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

Meta data access

2012-10-22 Thread Mamun
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)) (

Re: Why is EMPTY.withMeta(meta()) used instead of just EMPTY in clojure.lang.*?

2012-07-29 Thread Per Mildner
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   2   3   >