I verified the problem in the StackOverflow post. For some reason keyword
lookup of record fields in CLJS doesn't work.
Alan
On Tue, Aug 4, 2020 at 12:05 PM Justin Smith wrote:
> I don't think this is true, or if true is incidental to the real problem
>
> % cljs
> ClojureScript 1.10.758
>
I don't think this is true, or if true is incidental to the real problem
% cljs
ClojureScript 1.10.758
cljs.user=> (defrecord Attr [has-default default])
cljs.user/Attr
cljs.user=> (get (->Attr true 1) :default)
1
cljs.user=> (:default (->Attr true 1))
nil
cljs.user=>
On Tue, Aug 4, 2020 at
You misspelled default in your defrecord.
On Tue, Aug 4, 2020 at 7:42 AM 'clartaq' via Clojure <
clojure@googlegroups.com> wrote:
> I originally posted
> <https://stackoverflow.com/questions/63231270/accessing-record-fields-with-keywords-in-clojurescript-not-workin
I originally posted
<https://stackoverflow.com/questions/63231270/accessing-record-fields-with-keywords-in-clojurescript-not-working-as-in-clojure>
this on StackOverflow.
When I try this:
```clojure
(defrecord Attr [has-default default])
(def attr (->Attr true 1))
(get attr :defaul
As you point out, symbols in edn have no inherent meaning; it's entirely up
to how you interpret them. However, if you saw the symbol
"clojure.core/conj" in an edn file, then the chances are that it's intended
to refer to a Clojure function. Similarly, the symbol "PI" likely refers to
the
Thank you for responses.
The last two arguments do not resolve the doubt, however:
1. symbols also implement IFn:
(require 'clojure.edn)
('a (clojure.edn/read-string "{a 1 b 2}"))
=> 1
2. EDN does not specify any evaluation model, so how can a symbol designate
something "in
On Thu, 24 Oct 2019 at 16:48, Anton Vodonosov wrote:
> Regarding the idea that a keyword is an identifier that designates itself,
> while a symbol is a keyword that designates something else.
>
> Keys in config file map do not designate themselves, they designate the
> corresponding map values.
I think James talking about resolution of values when he said "designates",
not "the value bound to a key in the map." In other words, the keyword
:email resolves to the keyword :email, whereas the symbol clojure.core/vec
resolves to a function.
Keywords-as-keys give yo
d{3}" 2digits "\\d{2}"}
in another config section user can refer the regex by the symbols he
defined that way. So the map keys in user's definitions allow hig to give
names to values; here the names do not designate themselves, they are names
for the regular expressions.
Thinking tha
In edn, a keyword is an identifier that designates itself, while a symbol
is a keyword that designates something else.
This means keys in a map should generally be keywords, unless they identify
something beyond themselves. For example:
{:profiling/function-count {clojure.core/vec 10
My personal opinion is to prefer keywords, and prefer less preprocessing of
the configuration before the program uses it.
If it gets to a place where the configuration changes a lot, and a
"natural" (read: clojure-like) expression of the configuration in EDN has
either a lot of
I'm working on a config file format in EDN, and in doubt: should I use
keywords or symbols as map keys.
After all, the colon is an extra keyboard press - an extra effort for users.
As EDN parser doesn't evaluate expressions, there is no need to quote
symbols when using them as EDN map keys
We have the common use-case that we want to use double-colon keywords for
well known namespaces, without actually requiring the namespaces.
(defmacro ns-alias
"Set up a custom alias for use with namespace keywords."
[ns as]
`(do
(create-ns '~ns)
(alias '~as '~ns)))
T
Hi everyone,
I have ran into an issue with spec, and suspect it is a bug.
The following code throws an error:
(clojure.spec.alpha/conformer :foo)
The error is a java.lang.Exception and says: Unable to resalve spec; :foo
This is unexpected because I intend to use the keyword as a conformer
Thank you Justin, Andy, Alex and Thomas.
I now understand both the root of my issue (leading digits in keyword names
is not allowed) and have a greater understanding of how keywords work,
especially the reader's role in expanding double-colon keywords.
On Wednesday, January 30, 2019 at 2:53
To expand on what Alex already mentioned. There is no such thing as
double-colon keywords. Double-colon is a reader alias mechanism that let
the reader resolve them so you can type less.
(ns foo.bar.xyz)
::hello
this is resolved at read-time and identical to actually writing
:foo.bar.xyz
and namespaced
keywords is. When should we use single-colon keywords and when should we
use the double-colon variety?
On Tuesday, January 29, 2019 at 8:48:00 PM UTC-8, Alex Miller wrote:
>
>
>
> On Tuesday, January 29, 2019 at 10:07:29 PM UTC-6, Philip Markgraf wrote:
>>
On Tuesday, January 29, 2019 at 10:07:29 PM UTC-6, Philip Markgraf wrote:
>
> Thank you, Alex and Andy. This answers my question regarding leading digit
> in keywords.
>
>
> Alex,
> You describe an error with autoresolved keywords in my example. Is this
> also true
Thank you, Alex and Andy. This answers my question regarding leading digit
in keywords.
Alex,
You describe an error with autoresolved keywords in my example. Is this
also true of the second example I posted (in response to Justin), which
does not use the user namespace? Am I correct to use
There are two interrelated issues here.
First, when you are using autoresolved keywords, the qualifier part must be
an alias. Here it is a fully-qualified namespace (user). Instead, you
should be using :user/015-00. Note that before Clojure 1.10, this would not
produce an error
I believe the original intent was that keywords with a digit immediately
after the colon would not be supported, but due to a bug in the Clojure
reader they were permitted. There was a brief time in 2013 where this bug
was fixed, but there were enough extant Clojure code bases that used
gt; nil
> (ins)foo=> ::user/a
> RuntimeException Invalid token: ::user/a
> clojure.lang.Util.runtimeException (Util.java:221)
> (ins)foo=> :user/a
> :user/a
>
> On Tue, Jan 29, 2019 at 2:52 PM Philip Markgraf > wrote:
> >
> > I am moving some code
PM Philip Markgraf wrote:
>
> I am moving some code to use spec and namespaced keywords under Clojure
> 1.10.0 (release). One group of keywords starts with a numeric character after
> the colon, which has worked fine in the non-namespaced context. Creating and
> using the namespaced
I am moving some code to use spec and namespaced keywords under Clojure
1.10.0 (release). One group of keywords starts with a numeric character
after the colon, which has worked fine in the non-namespaced context.
Creating and using the namespaced keyword works correctly in the local
namespace
absolutely
sure* namespace is nil, use (keyword nil "something-empty") in your example.
Note that the keyword function will happily create keywords whose printed
form is either not readable (e.g. include a space, a digit in the wrong
place, a bad character, etc) or would be read a di
I think there's some confusion here between the keyword and its textual
representation.
The root issue is that the keyword function is, in a way, too lenient in its
error checking: it will allow you to create keywords that are not valid
according to the language definition. The Clojure reader
On Wed, Mar 21, 2018 at 7:48 AM, Nick Mudge <mud...@gmail.com> wrote:
> I see what you mean. All keywords are namespaced, so there really is no
> such thing as a no-namespaced keyword. Thank you.
>
You can have keywords without a namespace:
user> (clojure-version)
1.9.0
u
Don't know about older clojure versions, but running your code in the 1.9
repl I got this:
$ clj
Clojure 1.9.0
user=> (keyword (str "something" "-empty"))
:something-empty
On Wed, Mar 21, 2018 at 2:15 PM, Nick Mudge <mud...@gmail.com> wrote:
> I want to progr
I see what you mean. All keywords are namespaced, so there really is no
such thing as a no-namespaced keyword. Thank you.
On Wednesday, March 21, 2018 at 6:32:53 AM UTC-7, Alex Miller wrote:
>
> I believe you are mistaken as the keyword function will create
> :something-empty in
ax for :user/something-empty btw
> (where user is your current namespace), so it's not even possible to
> "create" a keyword like ::something-empty.
>
> On Wednesday, March 21, 2018 at 8:15:43 AM UTC-5, Nick Mudge wrote:
>>
>> I want to programmatically create so
Wednesday, March 21, 2018 at 8:15:43 AM UTC-5, Nick Mudge wrote:
>
> I want to programmatically create some keywords without namespaces? Or
> are we not supposed to do that?
>
> I can't use the "keyword" function because that only creates keywords with
>
I want to programmatically create some keywords without namespaces? Or are
we not supposed to do that?
I can't use the "keyword" function because that only creates keywords with
a namespace.
For example doing this:
(keyword (str "something" "-empty"))
Creates
:56:58 AM UTC-6, Khalid Jebbari wrote:
>>
>> Any reason we can't provide default value for sets and vectors when using
>> them as functions, whereas it works just fine for maps and keywords ?
>>
>> Examples :
>>
>> boot.user=> (["first" "second
it works just fine for maps and keywords ?
>
> Examples :
>
> boot.user=> (["first" "second"] 2 :nope)
> clojure.lang.ArityException: Wrong number of args (2) passed to:
> PersistentVector
>
> boot.user=> (#{1 2} 3 :nope)
>
Any reason we can't provide default value for sets and vectors when using
them as functions, whereas it works just fine for maps and keywords ?
Examples :
boot.user=> (["first" "second"] 2 :nope)
clojure.lang.ArityException: Wrong number of args (2) passed to:
Pers
conj
>>
>> []
>>
>> l))
>>
>>
>>
>> Hopefully that’ll give you some options to think about…
>>
>>
>>
>> Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
>> An Architect's View -- http://corfield.org/
>>
- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>
> --
> *From:* clojure@googlegroups.com <clojure@googlegroups.com> on behalf of
> Stephen Feyrer <stephen.fey...@gmail.c
Stephen
Feyrer <stephen.fey...@gmail.com>
Sent: Monday, November 13, 2017 5:19:32 PM
To: clojure@googlegroups.com
Subject: Re: Map Keywords are functions, why not vector elements?
Hi Alex, Didier,
Thanks for your patience.
That covers everything which I can think of and a fair bit more :) I
Hi Alex, Didier,
Thanks for your patience.
That covers everything which I can think of and a fair bit more :) I have
a bit of reading and thinking to do now.
Again, thank you.
--
Rule of thumb simple question, complicated answer
Stephen.
On 13 November 2017 at 22:09, Didier
Yo are looking for indexOf (.indexOf vector value).
(.indexOf ["a" "b"] "b")
=> 1
(.indexOf ["a" "b" "b"] "b")
=> 1
Note how indexOf searches for the index of the first value which matches value.
To do what you ask, is a query over a vector, which requires a search on each
element. This will
On Monday, November 13, 2017 at 11:40:10 AM UTC-6, Stephen Feyrer wrote:
>
> Updating subject to make it make more sense, hopefully.
>
> On 13 November 2017 at 14:15, Alex Miller <a...@puredanger.com> wrote:
>
>> Regarding the title, this is incorrect. Map keys are
Updating subject to make it make more sense, hopefully.
On 13 November 2017 at 14:15, Alex Miller <a...@puredanger.com> wrote:
> Regarding the title, this is incorrect. Map keys are not functions;
> keywords are functions that take an associative data structure and will
> loo
Bruce Hauman has done some work in this area both in figwheel and in a branch
of leiningen.
Basically, if I understand correctly, he looks for misspelled keywords in
configuration maps by taking the levenstein distance between expected, valid,
keywords and non-matching keywords
I have found eastwood to be useful for a number of things, however on
keyword checking it failed terribly on our code base, though perhaps there
have been updates since I last tried it.
Thanks for the suggestion though.
On Friday, February 3, 2017 at 7:26:01 PM UTC-5, Ben Brinckerhoff wrote:
>
at 1:49:20 AM UTC+1, tbc++ wrote:
>>
>> A good editor should auto-complete your keywords for you. Since using
>> this feature in Cursive (same sort of thing is available in other editors)
>> the cases where I've mis-spelled a keyword have dropped dramatically. It's
>> a
).
/Linus
On Friday, February 3, 2017 at 1:49:20 AM UTC+1, tbc++ wrote:
>
> A good editor should auto-complete your keywords for you. Since using this
> feature in Cursive (same sort of thing is available in other editors) the
> cases where I've mis-spelled a keyword have dropped dramat
The eastwood linter can also be configured to look for possibly misspelled
keyword typos
https://github.com/jonase/eastwood#keyword-typos
On Friday, February 3, 2017 at 3:47:21 AM UTC-7, John Schmidt wrote:
>
> I suggest something like (defn fetch-encrypted [] (fetch-important-data
> {:encrypt
I suggest something like (defn fetch-encrypted [] (fetch-important-data
{:encrypt true})) + unit tests
On Friday, February 3, 2017 at 2:56:34 AM UTC+1, Michael Gardner wrote:
>
> What would be the Right Way to deal with typos like (fetch-important-data
> {:encypt true}), where the :encrypt key
What would be the Right Way to deal with typos like (fetch-important-data
{:encypt true}), where the :encrypt key is optional? Timothy mentions
auto-complete, which is better than nothing but doesn't feel like a real
solution (especially to those who don't use auto-complete).
> On Feb 2, 2017,
A good editor should auto-complete your keywords for you. Since using this
feature in Cursive (same sort of thing is available in other editors) the
cases where I've mis-spelled a keyword have dropped dramatically. It's a
lot harder to mis-spell a keyword when you can just do: :egg/th and
the rest
Ugh, don't do that. Introducing layers that add no value is a bad idea. Just
use the keyword directly.
--
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
Keyword literals are inherently misspellable and trying to solve that
problem with Spec does not really hit the nail on the head. But there is a
solution: You do not have to use keyword literals very much!
Instead of using, say, :egg/thunder throughout your program, def a var as
:egg/thunder
Hello Alex,
The idea is (as I understand it) that every function should accept any
map and pick keys which it understands. If some keys are critical, then
they should be marked as such in the spec.
Function might iterate over keys and raise an error if there are keys
which belong to the
On Thursday, February 2, 2017 at 10:07:31 AM UTC-5, Alex Miller wrote:
>
> We don't encourage you to do this, but I don't have an easier solution
> than this.
>
Yes, and from the general standpoint of map handling I understand that.
>From the standpoint of functions that take options and don't
On Wednesday, February 1, 2017 at 6:12:35 PM UTC-6, Dave Tenny wrote:
>
> Looking at the documentation for keywords under
> https://clojure.org/reference/reader#_literals
> there is no mention for the syntax for namespace aliased keywords, and
> this is very important it you
We don't encourage you to do this, but I don't have an easier solution than
this.
On Thursday, February 2, 2017 at 7:05:37 AM UTC-6, Dave Tenny wrote:
>
> I want to specify in clojure spec that only declared keywords are
> permitted in function calls.
> This is to catch what are
I want to specify in clojure spec that only declared keywords are permitted
in function calls.
This is to catch what are usually mis-spelled or mis-cased keywors passed
via option maps in function calls.
In the fdefs below, the second fdef will catch an invalid call, e.g.
(f 1 {:a 2 :B 3
I also have to wonder why keyword namespaces aren't processed like other
symbol namespaces, that is, to interpret the namespace portion before a '/'
with alias consideration.
No doubt there's a good answer, but it seems anachronistic that keywords
need special syntax contortions to recognize
Looking at the documentation for keywords
under https://clojure.org/reference/reader#_literals
there is no mention for the syntax for namespace aliased keywords, and this
is very important it you want to manage your keywords for clojure.spec.
I only know about it because google turned up some
On Saturday, October 15, 2016 at 10:17:15 PM UTC-5, Josh Tilles wrote:
>
> I’ve got a couple questions for Alex Miller and/or the other Cognitect
> folks.
>
>1. *Are single-segment namespaces still “bad” when it comes to
>registering specs under qualified keywords?*
&
> That isn't me. I'm just chiming in from the peanut gallery. Must of my
> "experience" so far stems from converting
> my toy projects from prismatic schema to spec.
>
>>
>>1. *Are single-segment namespaces still “bad” when it comes to
>>registering specs
g
my toy projects from prismatic schema to spec.
>
>1. *Are single-segment namespaces still “bad” when it comes to
>registering specs under qualified keywords?*
>In the past, single-segment namespaces have been discouraged in the
>Clojure community—both because
I’ve got a couple questions for Alex Miller and/or the other Cognitect
folks.
1. *Are single-segment namespaces still “bad” when it comes to
registering specs under qualified keywords?*
In the past, single-segment namespaces have been discouraged in the
Clojure community—both
r 23, 2016 at 7:13:30 PM UTC-4, John Mastro wrote:
>
> Timothy Baldridge <tbald...@gmail.com > wrote:
> > The syntax (I think) comes from Ruby although they call keywords
> "symbols".
>
> The reader syntax for Common Lisp's keywords has the leading colon t
I'm starting to dive into clojure.spec, which is a strong motivation for me
to finally appreciate and use namespaced keywords -- an aspect of Clojure
that I've ignored until now.
I don't have a good sense of style re how to namespace keywords, especially
in standalone projects. I'm inclined
Timothy Baldridge <tbaldri...@gmail.com> wrote:
> The syntax (I think) comes from Ruby although they call keywords "symbols".
The reader syntax for Common Lisp's keywords has the leading colon too.
John
--
You received this message because you are subscribed t
come (
https://en.wikibooks.org/wiki/Learning_Clojure/Reader_Macros). And that's
just one of many reasons (without even mentioning backwards compatibility),
postfix colons on keywords will never happen.
>>
>
> Just to clear, I'm not suggesting that the current notation go away.
Breaking
t's
> just one of many reasons (without even mentioning backwards compatibility),
> postfix colons on keywords will never happen.
>
>
Just to clear, I'm not suggesting that the current notation go away.
Breaking backwards compatibility would be nuts, of course. Just wonder if
the alter
efixed.
So it's very natural to keep keywords the same way. The syntax (I think)
comes from Ruby although they call keywords "symbols".
So that would be my rationale for it..it's easy to see by the first
character of a term what data structure the term will become (
https://en.wikib
eyeing it for some time. Reading over numerous examples, there is one thing
about reading Clojure code that I find a bit hard to take -- keywords. Take
the example of metadata for a Cryogen post:
{:title "First Post!"
:layout :post
:date "2016-01-01"
:
Aha, got it. Just surprised me that it still worked without a map.
Thanks for clearing it up!
Cheers
On Tuesday, September 15, 2015 at 10:29:08 PM UTC-6, Carlo wrote:
>
> Symbols and keywords act as functions which look themselves up in their
> argument. Essentially:
>
> ('s
Hello All:
Noticed the following works in Clojure 1.6 and 1.7 (didn't test prior to
that):
user=> ('+ 'a 'b)
b
Also "works" for any set of symbols:
user=> ('abra 'ka 'dabra)
dabra
My expectation was that using symbols or keywords in the function/operator
position would th
Symbols and keywords act as functions which look themselves up in their
argument. Essentially:
('sym map) => (get map 'sym)
('sym map not-found) => (get map 'sym not-found)
(:key map) => (get map :key)
(:key map not-found) => (get map :key not-found)
It's often pretty u
Hi.
How many :keywords can I create in Clojure? Is there any limited
number of them? I know of such limitation of Erlang's atoms, which are
just like Clojure's keywords.
noniwoo
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group
There is no hard limit beyond available memory and JVM class size
limitations (which is really only relevant if your creating a ton of
keywords statically I think).
On Monday, September 15, 2014 3:32:40 PM UTC-4, Paweł Sabat wrote:
Hi.
How many :keywords can I create in Clojure
*you're
On Monday, September 15, 2014 4:23:46 PM UTC-4, adrian...@mail.yu.edu wrote:
There is no hard limit beyond available memory and JVM class size
limitations (which is really only relevant if your creating a ton of
keywords statically I think).
On Monday, September 15, 2014 3:32:40
Clojure's keyword is using a soft reference cache, they would be garbage
collected when used memory reaches threshold.
2014-09-15 18:36 GMT+08:00 Paweł Sabat noni...@gmail.com:
Hi.
How many :keywords can I create in Clojure? Is there any limited
number of them? I know of such limitation
I'm reading Cloujure in Action as an introduction to Clojure and,
although, I understand a keyword can be used as a function I don't
understand the difference between:
(ns org.currylogic.damages.http.expenses
(:require [clojure.data.json :as json-lib]
The ns form is a macro that takes a special syntax and always uses the
keyword form, as you have in your first example. Your second example is
incorrect; I'd be surprised if it even ran.
The reason for this is to make it clear that you're not executing the
require function directly, but instead
On 03/07/2014 18:36, James Reeves wrote:
The reason for this is to make it clear that you're not executing the
require function directly, but instead passing options to the ns form.
I don't understand not executing the require function directly.
I've also seen the when function called as
I believe you might have seen :when in the binding vector of either a for
or deseq form. Their special usage is documented
here: http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/for
In any event, James explained the distinction quite well. Macros are often
used to create
Keywords can be used as a function with a map, so the keyword will search
for itself in the map. Take a look at
http://clojure.org/data_structures#Data%20Structures-Keywords
In the case of the ns form, as James pointed out, what is happening is
not a function call. ns is a macro
One thing to note is that while it's true keywords can be used as
functions they can only really do one thing, which is get values from
maps. That is to say, the keyword-function :foo is equivalent to the
function #(get % foo). The function :foo has no relationship with the
function foo
Hi,
I am exploring javax.sound.midi using clojure and while creating keywords
for notes I wonder if I could use macros to generate the keywords -
(defn note-2-num [n]
(let [
m {
:C1 0
:C#1 1
:D1 2
:D#1 3
:E1 4
:F1 5
clojure and while creating keywords
for notes I wonder if I could use macros to generate the keywords -
(defn note-2-num [n]
(let [
m {
:C1 0
:C#1 1
:D1 2
:D#1 3
:E1 4
:F1 5
:F#1 6
:G1 7
Is a macro necessary?
https://gist.github.com/alexpw/8476780
On Friday, January 17, 2014 10:21:52 AM UTC-6, Kashyap CK wrote:
Hi,
I am exploring javax.sound.midi using clojure and while creating keywords
for notes I wonder if I could use macros to generate the keywords -
(defn note-2-num
/8476780
On Friday, January 17, 2014 10:21:52 AM UTC-6, Kashyap CK wrote:
Hi,
I am exploring javax.sound.midi using clojure and while creating keywords
for notes I wonder if I could use macros to generate the keywords -
(defn note-2-num [n]
(let [
m {
:C1 0
octave
Timothy
On Fri, Jan 17, 2014 at 9:21 AM, Kashyap CK ckka...@gmail.comjavascript:
wrote:
Hi,
I am exploring javax.sound.midi using clojure and while creating keywords
for notes I wonder if I could use macros to generate the keywords -
(defn note-2-num [n]
(let [
m
Maps, keywords, and symbols when used as operators allow optional second
arguments for 'default-not-found' values is if to 'get'.
E.g.
({:a 1} :b 'b) = b
However sets don't support this behavior (though they do with 'get') and
vectors don't allow the optional default-not-found in their pseudo
tickets though.
http://dev.clojure.org/jira/browse/CLJ
Alex
On Thursday, December 5, 2013 2:13:37 PM UTC-6, Dave Tenny wrote:
Maps, keywords, and symbols when used as operators allow optional second
arguments for 'default-not-found' values is if to 'get'.
E.g.
({:a 1} :b 'b) = b
regarding namespaced keywords (is that the right term?) such as ::l/test.
= (read-string ::l/test)
RuntimeException Invalid token: ::l/test
clojure.lang.Util.runtimeException (Util.java:219)
It seems that the reader requires the namespace alias 'l' to exist. This
is a shame because in most (all
I am reading a bunch of clojure files using the build-in reader (or
tools.reader, it has the same problem) and I am running into a problem
regarding namespaced keywords (is that the right term?) such as ::l/test.
= (read-string ::l/test)
RuntimeException Invalid token: ::l/test
Dave
On Tue, Sep 17, 2013 at 4:03 PM, Casper Clausen cas...@gmail.comjavascript:
wrote:
I am reading a bunch of clojure files using the build-in reader (or
tools.reader, it has the same problem) and I am running into a problem
regarding namespaced keywords (is that the right term
17, 2013 at 4:03 PM, Casper Clausen cas...@gmail.com wrote:
I am reading a bunch of clojure files using the build-in reader (or
tools.reader, it has the same problem) and I am running into a problem
regarding namespaced keywords (is that the right term?) such as ::l/test.
= (read-string ::l
at 4:03 PM, Casper Clausen cas...@gmail.comwrote:
I am reading a bunch of clojure files using the build-in reader (or
tools.reader, it has the same problem) and I am running into a problem
regarding namespaced keywords (is that the right term?) such as ::l/test.
= (read-string ::l/test
Dave
On Tue, Sep 17, 2013 at 4:03 PM, Casper Clausen cas...@gmail.comwrote:
I am reading a bunch of clojure files using the build-in reader (or
tools.reader, it has the same problem) and I am running into a problem
regarding namespaced keywords (is that the right term?) such as ::l/test
The double-colon is only shorthand for the current namespace:
Or other namespaces via an alias:
(alias 'clj 'clojure.core)
::clj/foo = :clojure.core/foo
Inside ns forms, the :as keyword creates aliases.
--
--
You received this message because you are subscribed to the Google
Groups Clojure
Cool. You learn something new every day :)
On Tuesday, September 17, 2013, Brandon Bloom wrote:
The double-colon is only shorthand for the current namespace:
Or other namespaces via an alias:
(alias 'clj 'clojure.core)
::clj/foo = :clojure.core/foo
Inside ns forms, the :as keyword
I have a sequence of keywords which I want to use match on. However, :when
has a special meaning, which means I cannot do something like:
(let [x [:ok :when :where]]
(match [x]
[[_ :when _]] :a0))
which gives a clojure.lang.Compiler$CompilerException:
java.lang.AssertionError: Assert
This is just a bug :when should only have special meaning if it occurs in a
list not a vector. Please file a ticket in JIRA:
http://dev.clojure.org/jira/browse/MATCH
David
On Sun, Jul 21, 2013 at 8:54 PM, Yong yong...@10gic.net wrote:
I have a sequence of keywords which I want to use match
1 - 100 of 226 matches
Mail list logo