1.8.0/1.9.0/1.10.0-RC1 -> 1.10.0 regression: Extending protocols with metadata / datafy combined with macros/symbols

2019-02-28 Thread Alex Miller
Please file a jira with this info at https://dev.clojure.org/jira/browse/CLJ -- 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 patie

1.8.0/1.9.0/1.10.0-RC1 -> 1.10.0 regression: Extending protocols with metadata / datafy combined with macros/symbols

2019-02-27 Thread 'somewhat-functional-programmer' via Clojure
bug.core$eval7278/ (form-init3641919424619236070.clj:49). No matching ctor found for class clojure.reflect$typesym$fn__11912 Basically, symbols used inside of macros that had the new datafy protocol added to their metadata caused this failure. My use case that lead my to having this issue in the

Docstrings and metadata on protocol method signatures

2018-07-09 Thread baptiste . fontaine
Hello, I tried adding :doc and :added metadata on a protocol method signature but found it hard to do: ;; defn-like, docstring then metadata map -> nope (defprotocol P (foo "mydoc" {:added "1.0"} [_])) ; => CompilerException java.lang.IllegalArgumentException: Para

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread Didier
You shouod also checkout https://github.com/jgpc42/insn/blob/master/README.md It was annouced a few weeks back, looks like a nice interface to ASM. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegro

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread Didier
I'm not fully following what you're doing or trying to do, but don't expect meta to compose. A lot of macros and functions can strip it away. Its best kept to annotate global static things. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
way eventually. >> >> I think the main difference is that the function now implements something >> like IPersistentMap rather than IObj. The problem I had was if the function >> was some Map-like object to begin with, I'd get confused about what was >> 'data&

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread Justin Smith
on now implements something > like IPersistentMap rather than IObj. The problem I had was if the function > was some Map-like object to begin with, I'd get confused about what was > 'data' and what was 'metadata'. > > On Wed, Sep 20, 2017 at 12:04 PM, Justin Smith

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
ction gets optimized away eventually. I think the main difference is that the function now implements something like IPersistentMap rather than IObj. The problem I had was if the function was some Map-like object to begin with, I'd get confused about what was 'data' and what was &#

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
ASM: I haven't done anything with ASM before. Any advice would be greatly appreciated. What I have in mind is using the org.ow2.asm, not the internal clojure.asm. I am imagining I can take a function's class and add 'implements IObj', a 'meta' field, and the necessary methods, and pass through e

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
t 12:05 PM, John McDonald wrote: > 3rd issue: metadata and function equality: > > I've never really understood the motivation for "Two objects that differ > only in metadata are equal." > Is there a good reference for that? > > For my purposes, it would probably

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
3rd issue: metadata and function equality: I've never really understood the motivation for "Two objects that differ only in metadata are equal." Is there a good reference for that? For my purposes, it would probably be better if 'metadata' did affect equality. Perhaps I

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread Justin Smith
t; elements. > 6.38ms primitive --- calls square.invokePrim(x[i]) to square the elements > 6.37ms boxprimitive --- calls square.invoke(x[i]) to square the elements > 6.37ms funxprimitive --- calls funxSquare.invokePrim(), where funxSquare > is square wrapped with MetaFn, an experimen

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
square wrapped with MetaFn, an experiment metadata wrapper. 6.38ms funxboxed --- calls funxSquare.invoke() 43.55ms boxed --- calls boxedSquare.invoke() , where boxedSquare is a version of square without type hints. 151.61ms cljmeta --- calls metaSquare.invoke(), where metasquare is the result of (wi

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
Thanks for the quick response. One issue at a time: (A) Putting metadata on Vars instead of on the functions themselves: I need to be able to associate facts with the function instances. I can't rely on every function being bound to a Var. For example, I'm constructing cost fun

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-19 Thread Alex Miller
e {:from 0.0 :to Double/POSITIVE_INFINITY :also Double/NaN}}) > > https://clojure.org/reference/metadata > <https://www.google.com/url?q=https%3A%2F%2Fclojure.org%2Freference%2Fmetadata&sa=D&sntz=1&usg=AFQjCNHbXrwRkSRL6pFAprN1DcrQPUEbJA> > > says "Symbols and collections s

functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-19 Thread John Alan McDonald
I'd like to be able to do something like: (defn square ^double [^double x] (* x x)) (def meta-square (with-meta square {:domain Double/TYPE :codomain Double/TYPE :range {:from 0.0 :to Double/POSITIVE_INFINITY :also Double/NaN}}) https://clojure.org/reference/metadata says "S

Re: changing metadata questions

2016-05-13 Thread hiskennyness
h? The :meta > option on ref? > > [1] Why the special mechanism? > > Well, when in Rome...: > > (let [x (ref {:a 42} >> :meta {:m 17})] >> (alter-meta! x #(assoc-in % [:m] 64)) >> (meta x)) >> ;; => {:m 64} > > > Booyow! &g

changing metadata questions

2016-05-12 Thread hiskennyness
It occurred to me that the game I was playing shunting initargs off into a "raw" key of one name or another before converting them into a map might more comprehensibly be done by treating the raw values (and other attributes I use to manage these beasts) as metadata. But I need to u

Re: Using metadata to specify how calls to a macro should be indented

2015-09-23 Thread Artur Malabarba
Great! ☺ Bring it up on the cider gitter room. On 23 Sep 2015 3:55 pm, "Phillip Lord" wrote: > Artur Malabarba writes: > >> > > Yes, that's what the current (but unmerged) implementation does. :) > > > >> If this cache were persisted between Emacs sessions then the problem > >> largely goes away

Re: Using metadata to specify how calls to a macro should be indented

2015-09-23 Thread Phillip Lord
Artur Malabarba writes: >> > Yes, that's what the current (but unmerged) implementation does. :) > >> If this cache were persisted between Emacs sessions then the problem >> largely goes away. >> > Yes, that's very plausible to do. I am happy to do the implementation for this (i.e. the persistanc

Re: Using metadata to specify how calls to a macro should be indented

2015-09-23 Thread Artur Malabarba
2015-09-23 10:32 GMT+01:00 Phillip Lord : > Specifically wrt to CIDER, the easier solution is the cache the metadata > map each time it is used. I suspect that CIDER would need this for > performance -- I mean indentation requiring ongoing evaluation in > Clojure is likely to be slow.

Re: Using metadata to specify how calls to a macro should be indented

2015-09-23 Thread Phillip Lord
rently do, and they're no > worse off. > > The editor can even parse the metadata map present in the defn/defmacro, so > as to provide some "offline" support (though I don't foresee Cider doing > that). It's worth being explicit in the spec, then, about wh

Re: Using metadata to specify how calls to a macro should be indented

2015-09-22 Thread Artur Malabarba
can even parse the metadata map present in the defn/defmacro, so as to provide some "offline" support (though I don't foresee Cider doing that). On 22 Sep 2015 11:31 am, "Phillip Lord" wrote: > > > > Artur Malabarba writes: > > Over at CIDER we'r

Re: Using metadata to specify how calls to a macro should be indented

2015-09-22 Thread Phillip Lord
I am sure. I do, though. I often write and improve documentation without a REPL, especially when I am using my old netbook. The REPL shortens the battery live and isn't that useful when writing English. Still, the problem is soluable in a number of ways, I guess, and I can't think o

Re: Using metadata to specify how calls to a macro should be indented

2015-09-22 Thread Colin Yates
Do you know about lein figwheel? On 22 Sep 2015 21:05, "Gary Trakhman" wrote: > Sometimes more than 0% when I'm doing something small in clojurescript, > can't be bothered with the setup, and browser refresh is good enough :-). > On Tue, Sep 22, 2015 at 4:02 PM Fluid Dynamics wrote: > >> On Tues

Re: Using metadata to specify how calls to a macro should be indented

2015-09-22 Thread Gary Trakhman
Sometimes more than 0% when I'm doing something small in clojurescript, can't be bothered with the setup, and browser refresh is good enough :-). On Tue, Sep 22, 2015 at 4:02 PM Fluid Dynamics wrote: > On Tuesday, September 22, 2015 at 6:31:34 AM UTC-4, Phillip Lord wrote: >> >> ... The interesti

Re: Using metadata to specify how calls to a macro should be indented

2015-09-22 Thread Fluid Dynamics
On Tuesday, September 22, 2015 at 6:31:34 AM UTC-4, Phillip Lord wrote: > > ... The interesting question then is what > percentage of the time do Clojure developers work *without* a repl > active. > Uhhh, zero? :) -- You received this message because you are subscribed to the Google Groups "C

Re: Using metadata to specify how calls to a macro should be indented

2015-09-22 Thread Phillip Lord
Artur Malabarba writes: > Over at CIDER we're adding a feature where the author of a macro (or > function) can specify how that macro should be indented by adding an :indent > metadata to its definition. This way the editor (and other tools, like > cljfmt) will know what&#x

Re: Using metadata to specify how calls to a macro should be indented

2015-09-19 Thread Artur Malabarba
Nice. It's good to see that it's so similar. Apparently they use a separate spec for grouping args as well. 2015-09-17 8:28 GMT+01:00 Jozef Wagner : > Dunaj uses metadata to guide IDEs and pretty printer regarding > indentations, arg grouping, ... > > http://www.d

Re: Using metadata to specify how calls to a macro should be indented

2015-09-19 Thread Artur Malabarba
n it's author, and the metadata is the same place that carries other info like arglists or docstrings. Then again, maybe I'm just used to it because emacs-lisp uses a similar system. > * sets up a bikeshed at the top of every def* form > As bozhidar mentioned, this will only go on

Re: Using metadata to specify how calls to a macro should be indented

2015-09-17 Thread Jozef Wagner
Dunaj uses metadata to guide IDEs and pretty printer regarding indentations, arg grouping, ... http://www.dunaj.org/metadata.html#_indentation http://www.dunaj.org/day10.html#_ide_support Jozef On Sunday, September 13, 2015 at 12:06:50 PM UTC+2, Artur Malabarba wrote: > > Hi ev

Re: Using metadata to specify how calls to a macro should be indented

2015-09-16 Thread Bozhidar Batsov
edev-users/NzKTeY722-I/3hmNvJulcksJ >> >> Best, >> >> - Chas >> >> >> On 09/13/2015 06:06 AM, Artur Malabarba wrote: >> >> Hi everyone, >> >> >> Over at CIDER we're adding a feature where the author of a macro (o

Re: Using metadata to specify how calls to a macro should be indented

2015-09-16 Thread Colin Fleming
Artur Malabarba wrote: > > Hi everyone, > > > Over at CIDER we're adding a feature where the author of a macro (or > function) can specify how that macro should be indented by adding an > :indent metadata to its definition. This way the editor (and other tools, > like cl

Re: Using metadata to specify how calls to a macro should be indented

2015-09-16 Thread Chas Emerick
.com/forum/#!msg/clojuredev-users/NzKTeY722-I/3hmNvJulcksJ Best, - Chas On 09/13/2015 06:06 AM, Artur Malabarba wrote: Hi everyone, Over at CIDER we're adding a feature where the author of a macro (or function) can specify how that macro should be indented by adding an |:indent| me

Re: Using metadata to specify how calls to a macro should be indented

2015-09-16 Thread Artur Malabarba
2015-09-15 20:08 GMT+01:00 Josh Tilles : > I suspect that “Matching Socks” meant that there should be a standard > namespace, similar to how the recent Socket Server REPL design > > uses > a “repl” namespa

Re: Using metadata to specify how calls to a macro should be indented

2015-09-16 Thread Artur Malabarba
control to be annotated, e.g. core. Perhaps > library owners could produce an EDN doc containing these specs? Or perhaps > we could obey annotations in the functions themselves, but I think that > some way to additionally annotate external things is essential. > I think it's important

Re: Using metadata to specify how calls to a macro should be indented

2015-09-15 Thread Colin Fleming
This is an interesting proposal, and I like it in general. Everything in Cursive is based on extensions identified by the head form, like this: (style/register-formatting :clojure.core/def :only-indent) (style/register-formatting :clojure.core/defn- :only-indent) (style/register-formatting resolve

Re: Using metadata to specify how calls to a macro should be indented

2015-09-15 Thread Josh Tilles
On Sunday, September 13, 2015 at 8:25:42 AM UTC-4, Artur Malabarba wrote: > > > On 13 Sep 2015 12:33 pm, "Matching Socks" > wrote: > > > > Unless clojure.core itself will carry these annotations, could the > keyword be namespaced? > > Or do you mean it should be ::indent? (i.e., carry the names

Re: Using metadata to specify how calls to a macro should be indented

2015-09-13 Thread Fluid Dynamics
On Sunday, September 13, 2015 at 12:10:00 PM UTC-4, Artur Malabarba wrote: > > > This scheme won't play nicely with forms with variable numbers of > special > > arguments. > > True, but I've never seen anyone indent specially these optional > arguments. For instance, every defn I see (including

Re: Using metadata to specify how calls to a macro should be indented

2015-09-13 Thread Artur Malabarba
> This scheme won't play nicely with forms with variable numbers of special > arguments. True, but I've never seen anyone indent specially these optional arguments. For instance, every defn I see (including clojure.core), is indented like this: (defn foo [x] (+ x 3)) (defn bar "Adds four t

Re: Using metadata to specify how calls to a macro should be indented

2015-09-13 Thread Fluid Dynamics
This scheme won't play nicely with forms with *variable numbers of special arguments*. Of which one is one of the most common macros to use: (defn foo [x] (+ x 3)) (defn bar "Adds four to x." [x] (+ x 4)) -- You received this message because you are subscribed to the Goog

Re: Using metadata to specify how calls to a macro should be indented

2015-09-13 Thread Sean Grove
where the author of a macro (or > function) can specify how that macro should be indented by adding an > :indent metadata to its definition. This way the editor (and other tools, > like cljfmt) will know what's the proper way of indenting any macro (even > those custom-defined) with

Re: Using metadata to specify how calls to a macro should be indented

2015-09-13 Thread Artur Malabarba
2015-09-13 11:15 GMT+01:00 Colin Yates : > - the name ‘indent’ and what it is actually capturing are at different > levels of abstraction. Possibly ‘structure’ might be a better name as that > is what it is describing? Good point, we should consider this. Though :structure might be a little too a

Re: Using metadata to specify how calls to a macro should be indented

2015-09-13 Thread Artur Malabarba
On 13 Sep 2015 1:25 pm, "Artur Malabarba" > Or do you mean it should be ::indent? Typo. Ignore the "Or". -- 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

Re: Using metadata to specify how calls to a macro should be indented

2015-09-13 Thread Artur Malabarba
On 13 Sep 2015 12:33 pm, "Matching Socks" wrote: > > Unless clojure.core itself will carry these annotations, could the keyword be namespaced? Or do you mean it should be ::indent? (i.e., carry the namespace of the var that they're applied on) In this case, I think it would only make things more

Re: Using metadata to specify how calls to a macro should be indented

2015-09-13 Thread Matching Socks
Unless clojure.core itself will carry these annotations, could the keyword be namespaced? -- 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 -

Re: Using metadata to specify how calls to a macro should be indented

2015-09-13 Thread Bozhidar Batsov
ace, ccw, cljfmt, etc) will be hugely beneficial for everyone. As for the spec itself - I'd only suggest using some keyword instead of `nil`, as it would probably be more intention revealing. I have no preference about the name of the metadata key itself. On 13 September 2015 at 13:15, Colin Yat

Re: Using metadata to specify how calls to a macro should be indented

2015-09-13 Thread Colin Yates
adding a feature where the author of a macro (or > function) can specify how that macro should be indented by adding an :indent > metadata to its definition. This way the editor (and other tools, like > cljfmt) will know what's the proper way of indenting any macro (even those > c

Using metadata to specify how calls to a macro should be indented

2015-09-13 Thread Artur Malabarba
Hi everyone, Over at CIDER we're adding a feature where the author of a macro (or function) can specify how that macro should be indented by adding an :indent metadata to its definition. This way the editor (and other tools, like cljfmt) will know what's the proper way of ind

Re: supporting metadata caret reader syntax with deftype

2015-09-05 Thread Mike Rodriguez
rround the returned symbol with quote to prevent the compiler from resolving through it post-reading. Putting the metadata outside the quote is just attaching it to a list for, from the readers perspective. It doesn't know it is a quote etc. -- You received this message because you are subscribe

Re: supporting metadata caret reader syntax with deftype

2015-09-05 Thread Artur Malabarba
I had the same issue a couple of months ago. The thing to understand is that 'a is NOT a symbol. Actually, it evaluates to a symbol, which is a different thing. When you write ^{:a 1} 'a, it is the same as writing ^{:a 1} (quote a). So the metadata gets applied to the entire form, not

Re: supporting metadata caret reader syntax with deftype

2015-09-04 Thread Gregg Reynolds
On Fri, Sep 4, 2015 at 7:51 PM, Mike Rodriguez wrote: > This has came up numerous times in other posts here. I can't hunt them > down currently but the quoted symbol issue you showed is just a > misunderstanding of how the reader macro for metadata works. > > Try (meta 

Re: supporting metadata caret reader syntax with deftype

2015-09-04 Thread Mike Rodriguez
This has came up numerous times in other posts here. I can't hunt them down currently but the quoted symbol issue you showed is just a misunderstanding of how the reader macro for metadata works. Try (meta '^{:foo :bar} a) When you put the reader macro in front of the quote it is

Re: supporting metadata caret reader syntax with deftype

2015-09-04 Thread Gregg Reynolds
and "withMeta". Seems to work just fine: > > (with-meta (entity-map [:A/B] {:a 1}) {:foo "metadata here"}) > > But this doesn't work: ^{:foo "metadata there"}(entity-map [:A/B] {:a 1}) > Ok, so (entity-map...) is passed to the MetaReader as a Persi

supporting metadata caret reader syntax with deftype

2015-09-04 Thread Gregg Reynolds
I have a deftype that supports with-meta, but I can't figure out how to support caret reader syntax. To support with-meta, I include a "meta" field and implement IObj methods "meta" and "withMeta". Seems to work just fine: (with-meta (entity-map [:A/B] {:

Re: :arglists metadata on defmulti/defmethod forms

2015-08-23 Thread James Reeves
I tend to add the metadata in manually when I write multimethods. (defmulti foo "Does some foo to x." {:arglists '([x])} :type) - James On 23 August 2015 at 16:51, Dave Tenny wrote: > defmulti+detmethod doesn't seem to maintain any :arglists metadata with >

:arglists metadata on defmulti/defmethod forms

2015-08-23 Thread Dave Tenny
defmulti+detmethod doesn't seem to maintain any :arglists metadata with the Var filled by defmulti. How can I look up arglist information for multimethods like I can for regular function vars? -- You received this message because you are subscribed to the Google Groups "Clojure&

Re: Metadata

2015-08-05 Thread James Reeves
Metadata is perhaps most frequently used on vars: user=> (meta #'comp) {:arglists ([] [f] [f g] [f g & fs]), :doc "Takes a set of functions and returns a fn that is the composition\n of those fns. The returned fn takes a variable number of args,\n applies the rightmost o

Re: Metadata

2015-08-05 Thread Daniel Compton
Codox looks for ^no-doc when it is generating documentation to elide docs for that function or namespace. On Thu, 6 Aug 2015 at 12:24 AM Eric Le Goff wrote: > The page http://clojure.org/metadata states that it "can also be used by > application developers for many purposes, anno

Metadata

2015-08-05 Thread Eric Le Goff
The page http://clojure.org/metadata states that it "can also be used by application developers for many purposes, annotating data sources, policy etc." Could anyone elaborate about some real use case scenarios where they need to use this metadata feature ? Regards, -- Eric Le

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-06-02 Thread Richard Möhn
Am Donnerstag, 28. Mai 2015 07:57:37 UTC+9 schrieb Colin Fleming: > > […] > > Much of this is specific to editing environments, and more concretely > specific to Cursive. It's also mostly necessary because I'm working from > unexpanded source rather than introspecting a REPL. > I see. I think

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-27 Thread Colin Fleming
Macros talk for a similar approach. Things that extensions can currently do: 1. Describe var metadata for global symbols (vars) 2. Describe local bindings (what their scope is, what their type is, etc) 3. How to extract the arglists from a particular form 4. Whether the form is a threading f

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-25 Thread Richard Möhn
Am Freitag, 22. Mai 2015 11:09:40 UTC+9 schrieb Colin Fleming: > > On one of the latest Cognicasts, Colin Fleming talked about a repo where >> library authors can upload extensions that help the IDE understand their >> macros. I have to listen to it again, but it sounded a bit like what you're

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-21 Thread Colin Fleming
> > On one of the latest Cognicasts, Colin Fleming talked about a repo where > library authors can upload extensions that help the IDE understand their > macros. I have to listen to it again, but it sounded a bit like what you're > talking about. Right now I can't find that repo, though. Maybe he w

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-21 Thread Richard Möhn
Thanks for the great feedback! Am Freitag, 22. Mai 2015 05:48:38 UTC+9 schrieb Laurent PETIT: > > Sorry for jumping late inside the pool, but the topic has retained my > attention from day one. > > As a developer of an IDE plugin (CounterClockWise for Eclipse), I'm very > interested in this effo

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-21 Thread Laurent PETIT
Sorry for jumping late inside the pool, but the topic has retained my attention from day one. As a developer of an IDE plugin (CounterClockWise for Eclipse), I'm very interested in this effort. Here are my ideas/questions/remarks: - Finding a winning scenario for adoption is key. A perfect tool w

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-21 Thread Alex Miller
It is a non-goal to define any new "standard" metadata for vars as part of the project. But it does seem reasonable that retaining var metadata and making it available would be useful to enable tooling for examples or anything else. On Thursday, May 21, 2015 at 1:15:17 PM UTC-5, Ru

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-21 Thread Russell Mull
d place to put that data would be nicer. (although it would have to be a clojure-focused LP tool for this to work) I'm not really in love with this idea, as it doesn't feel very lisp-y. Reversing the relationship, it could be nice to offer some standard LP-related metadata abou

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-19 Thread Richard Möhn
Just trying to bump this up a bit. "Coding" will start soon, so I'd be happy about some more input. Especially if you have further thoughts or wishes along the lines of https://groups.google.com/d/topic/clojure/E1oxVE4UMxQ/discussion. -- You received this message because you are subscribed to

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-06 Thread Alex Miller
On Wednesday, May 6, 2015 at 3:30:57 PM UTC-5, Fluid Dynamics wrote: > > On Wednesday, May 6, 2015 at 4:09:54 PM UTC-4, Alex Miller wrote: >> >> Yes, I think that's largely correct. The goal of Richard's project is to >> create an information model (data) describing a project from the >> perspec

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-06 Thread Fluid Dynamics
On Wednesday, May 6, 2015 at 4:09:54 PM UTC-4, Alex Miller wrote: > > Yes, I think that's largely correct. The goal of Richard's project is to > create an information model (data) describing a project from the > perspective of use. Codeq goes much deeper by integrating code history - > that allo

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-06 Thread Alex Miller
out of scope for this project. That information will be put into the model by producers and can be used by any consumer (who might understand some such format), but I think defining that specific structure is not what we're talking about. However, arbitrary metadata (expressed as data) a

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-06 Thread Alex Miller
On Tuesday, May 5, 2015 at 7:37:47 PM UTC-5, richar...@posteo.de wrote: > > > > Am Mittwoch, 6. Mai 2015 07:17:54 UTC+9 schrieb kovasb: >> >> I'm mostly interested in something like >> http://docs.racket-lang.org/scribble/ >> > > Thanks for the idea! There is http://clojure-scribble.publicfields.

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-06 Thread Alex Miller
ocumented, well-marketed Codeq. >> > > Oh, Codeq! I heard about it a long time ago on the Cognicast and it has > been hopping across my mind now and then. I would also like it to come to > life again. While it's not quite in the scope of my project, I think it > coul

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-06 Thread Phillip Lord
the real problem is the lack of conventions for adding metadata to > docstrings. I sorely miss `some-func/var' and SOME-PARAM from Emacs Lisp. > It's always > clear where you refer to other functions/variables and to parameters. This > makes it way easier to read (and parse)

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-06 Thread Bozhidar Batsov
I think the real problem is the lack of conventions for adding metadata to docstrings. I sorely miss `some-func/var' and SOME-PARAM from Emacs Lisp. It's always clear where you refer to other functions/variables and to parameters. This makes it way easier to read (and parse) a docstring.

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-06 Thread Phillip Lord
e (first s) returns x and (rest s) returns seq. Not sure whether this is in scope or not, but it is about usage of metadata. Phil -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Andrey Antukh
Thank you very much to all! Now I completely understand the metadata behavior with the reader. I'll try to adopt eastwood, thanks for the suggestion. Is clearly that the documentation confuses a little bit. Cheers! Andrey 2015-05-05 23:25 GMT+02:00 James Reeves : > The documentation i

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Mike Rodriguez
In reference to [1]: I do feel like the metadata loss on many macros is undesirable though and I wish it were addressed. It certainly feels "unhygienic", just in a new sense of the term. [1] https://github.com/jonase/eastwood#unused-meta-on-macro -- You received this message b

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Mike Rodriguez
+1 to Eastwood. It is great. -- 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 from t

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Andy Fingerhut
The Eastwood [1] Clojure lint tool has a few warnings in it that warn about unused metadata in your code. The :unused-meta-on-macro warns about metadata on macro invocations, which is usually ignored by Clojure [2]. The :wrong-tag warns about unused type tag metadata on Vars, and non-fully

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Mike Rodriguez
What you wanted here was (meta '^:abc some-symbol) It's a little weird but the reader attaches the metadata to the symbol. Then the quote just evaluates directly to the same symbol, so the metadata is preserved. I agree that metadata can be confusing though. Especially around

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-05 Thread richard . moehn
Am Mittwoch, 6. Mai 2015 07:17:54 UTC+9 schrieb kovasb: > > I'm mostly interested in something like > http://docs.racket-lang.org/scribble/ > Thanks for the idea! There is http://clojure-scribble.publicfields.net/, which you might know already. Maybe something like that could also be integra

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread 'wparke...@yahoo.com' via Clojure
>From your comments, I suspect this may be a source of confusion as well: When you have something like (defn ^{:doc "Increments"} a-fn [x] (+ x 1)) the metadata is attached to the symbol at read time. However, during the compilation process, the metadata on the symbol is transferr

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-05 Thread kovas boguta
e >> benefited from a revamped, well-documented, well-marketed Codeq. >> > > Oh, Codeq! I heard about it a long time ago on the Cognicast and it has > been hopping across my mind now and then. I would also like it to come to > life again. While it's not quite in th

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread adrian . medina
Because ' is a reader macro which expands to the list (quote some-symbol), so the metadata is applied to the list, and not the symbol. You can verify this in the REPL - (meta (quote ^:abc 'some-symbol)) On Tuesday, May 5, 2015 at 5:43:19 PM UTC-4, Andy- wrote: > > Frankly,

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread James Reeves
I expect because 'some-symbol is shorthand for (quote some-symbol), so you're attaching the metadata to a list that disappears once it's evaluated. - James On 5 May 2015 at 22:43, Andy- wrote: > Frankly, I would've (meta ^:abc 'some-symbol) expected to work. Maybe

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Andy-
ocumentation says very clearly that: > > In addition to with-meta, there are a number of reader macros (The Reader: > Macro Characters) for applying metadata to the expression following it: > ^{:doc "How obj works!"} obj - Sets the metadata of obj to the provided > map

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread James Reeves
The documentation is rather misleading, as it implies that "obj" can be a symbol. However, because ^ is a reader macro, it is applied to "obj" before it is evaluated. Clojure maps, vectors and sets all evaluate to themselves, so attaching metadata to the unevaluated express

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Andrey Antukh
Thanks to both for the responses, but I stil not clearly understand. The documentation says very clearly that: In addition to with-meta, there are a number of reader macros (The Reader: Macro Characters) for applying metadata to the expression following it: ^{:doc "How obj works!"}

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Andy-
In addition to James comment: IMO clojure.org/metadata should be clearer about this. It's mentioned more clearly on the reader page: http://clojure.org/reader#The%20Reader--Macro%20characters "The metadata reader macro first reads the metadata and attaches it to the next form read (see

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread James Reeves
When dealing with metadata, it's important to understand the difference between these two expressions: ^{:foo :bar} baz (with-meta baz {:foo :bar}) The first expression attaches metadata to the 'baz' symbol at compile time. The second expression attaches metadata to t

Metadata loss. What am I doing wrong?

2015-05-05 Thread Andrey Antukh
Hi! I have some trouble with clojure metadata / reader and I do not know if I'm doing something wrong. I have this code: (defn some-func []) (def func ^:abc some-func) (assert (= (meta func) {:abc true})) (def data [[:bar (with-meta some-func {:abc true})] [:baz ^:abc some

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-04 Thread richard . moehn
now and then. I would also like it to come to life again. While it's not quite in the scope of my project, I think it could be one of the tools that can be (re)built on top of the metadata from my project. Maybe I'm remembering Codeq wrong, but I think it could "just" be re

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-04 Thread Sean Grove
n!) > For > those who like to decide from the first paragraph whether they will read > on or > not: the goal of my project is to develop a model for Clojure source > metadata > (most of them are documentation) and ways to capture and publish them. The > following two paragraph

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-04 Thread richard . moehn
I just saw that the plain text formatting is horrible. Sorry for that. -- 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 wit

[ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-04 Thread richard . moehn
op a model for Clojure source metadata (most of them are documentation) and ways to capture and publish them. The following two paragraphs are taken from my project proposal: ❧ To the joy of the community, the number of Clojure-based libraries is steadily growing. To the dismay of the community

Re: into still losing metadata (CLJ-916)

2015-04-03 Thread Gregg Reynolds
On Fri, Apr 3, 2015 at 8:06 AM, Alex Miller wrote: > The CLJ-916 commit ( > https://github.com/clojure/clojure/commit/b5d0e84f92038449312bea4c31dcdedd499e28b8) > looks like it preserved meta on the to collection but did not merge meta > from the from collection, so as far as I can tell this is a

Re: into still losing metadata (CLJ-916)

2015-04-03 Thread Alex Miller
seems unlikely we'll get it into 1.7. On Friday, April 3, 2015 at 7:14:31 AM UTC-5, Gregg Reynolds wrote: > > Hi, > > http://dev.clojure.org/jira/browse/CLJ-916 reports that into loses > metadata; it is marked closed and fixed in 1.5. However, into still seems > to b

into still losing metadata (CLJ-916)

2015-04-03 Thread Gregg Reynolds
Hi, http://dev.clojure.org/jira/browse/CLJ-916 reports that into loses metadata; it is marked closed and fixed in 1.5. However, into still seems to be losing metadata. The relevant code from 1.7-alpha6 (core.clj) is: (if (instance? clojure.lang.IEditableCollection to) (with-meta

  1   2   3   4   5   6   >