Re: Literal map keys are checked for duplication before evaluation?

2017-01-04 Thread Carlo Zancanaro

On Thu, Jan 05 2017, Tianxiang Xiong wrote
> We can have:
>
> user=> {(+ 1 2) 1 (+ 2 1) 2}
> IllegalArgumentException Duplicate key: 3  
> clojure.lang.PersistentArrayMap.createWithCheck
> (PersistentArrayMap.java:71)
>
>
> So clearly a check is also made *after* evaluating the key forms. I'm just
> not sure why we need to check *before* evaluating the key forms.

The problem is that the reader produces a *map* as the result of reading
the form. Given '(+ 1 2) is equal to '(+ 1 2), the reader can't store
both values (because a map has only one value per key). Instead of
picking one of them arbitrarily (with the surprising behaviour of
dropping a form at /read/ time) it throws an exception.

Carlo

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: Literal map keys are checked for duplication before evaluation?

2017-01-04 Thread Tianxiang Xiong
We can have:

user=> {(+ 1 2) 1 (+ 2 1) 2}
IllegalArgumentException Duplicate key: 3  
clojure.lang.PersistentArrayMap.createWithCheck 
(PersistentArrayMap.java:71)


So clearly a check is also made *after* evaluating the key forms. I'm just 
not sure why we need to check *before* evaluating the key forms.


On Wednesday, January 4, 2017 at 9:16:26 PM UTC-8, tbc++ wrote:
>
> The check is made at read-time, by the time to form gets to the compiler 
> it's already a hash-map and one of your forms will have been dropped. So 
> the decision was made to make the reader check. One way you could solve 
> your problem here is with tagged literals, as the literal would be created, 
> and therefore the UUID would be unique before you even got to the creation 
> of the hash-map.
>
> http://clojure.org/reference/reader#_tagged_literals
>
> In short though...what should the reader do, it has no clue which of your 
> two key/value pairs to drop.  
>
> On Wed, Jan 4, 2017 at 9:05 PM, Tianxiang Xiong  > wrote:
>
>> Using a Clojure 1.8.0 REPL, I get the following:
>>
>> user=> {(+ 1 2) 1 (+ 1 2) 2}
>> IllegalArgumentException Duplicate key: (+ 1 2)  clojure.lang.
>> PersistentArrayMap.createWithCheck (PersistentArrayMap.java:71)
>>
>> It seems that the a check for key equality is made *before* the key is 
>> evaluated, when they are still strings.
>>
>> PersistentArrayMap/createWithCheck is as below:
>>
>> static public PersistentArrayMap createWithCheck(Object[] init){
>> for(int i=0;i< init.length;i += 2)
>> {
>> for(int j=i+2;j> {
>> if(equalKey(init[i],init[j]))
>> throw new IllegalArgumentException("Duplicate key: " + init[i]);
>> }
>> }
>> return new PersistentArrayMap(init);
>> }
>>
>> The MapReader in LispReader.java seems to pass an Object[] of Strings to 
>> PersistentArrayMap/createWithCheck.
>>
>> public static class MapReader extends AFn{
>> public Object invoke(Object reader, Object leftparen, Object opts, Object 
>> pendingForms) {
>> PushbackReader r = (PushbackReader) reader;
>> Object[] a = readDelimitedList('}', r, true, opts, 
>> ensurePending(pendingForms)).toArray();
>> if((a.length & 1) == 1)
>> throw Util.runtimeException("Map literal must contain an even number of 
>> forms");
>> return RT.map(a);
>> }
>>
>> }
>>
>>
>> This behavior is surprising. Is there a reason the map creation process 
>> works this way?
>>
>> The above example may seem trivial, since we would have duplicate keys 
>> after evaluation as well, but consider the generation of random values:
>>
>> user=> {(java.util.UUID/randomUUID) 1 (java.util.UUID/randomUUID) 2}
>> IllegalArgumentException Duplicate key: (java.util.UUID/randomUUID) 
>>  clojure.lang.PersistentArrayMap.createWithCheck 
>> (PersistentArrayMap.java:71)
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> “One of the main causes of the fall of the Roman Empire was that–lacking 
> zero–they had no way to indicate successful termination of their C 
> programs.”
> (Robert Firth) 
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Literal map keys are checked for duplication before evaluation?

2017-01-04 Thread Mark Engelberg
Another workaround:
(array-map (java.util.UUID/randomUUID) 1 (java.util.UUID/randomUUID) 2)

On Wed, Jan 4, 2017 at 9:16 PM, Timothy Baldridge 
wrote:

> The check is made at read-time, by the time to form gets to the compiler
> it's already a hash-map and one of your forms will have been dropped. So
> the decision was made to make the reader check. One way you could solve
> your problem here is with tagged literals, as the literal would be created,
> and therefore the UUID would be unique before you even got to the creation
> of the hash-map.
>
> http://clojure.org/reference/reader#_tagged_literals
>
> In short though...what should the reader do, it has no clue which of your
> two key/value pairs to drop.
>
> On Wed, Jan 4, 2017 at 9:05 PM, Tianxiang Xiong  > wrote:
>
>> Using a Clojure 1.8.0 REPL, I get the following:
>>
>> user=> {(+ 1 2) 1 (+ 1 2) 2}
>> IllegalArgumentException Duplicate key: (+ 1 2)  clojure.lang.
>> PersistentArrayMap.createWithCheck (PersistentArrayMap.java:71)
>>
>> It seems that the a check for key equality is made *before* the key is
>> evaluated, when they are still strings.
>>
>> PersistentArrayMap/createWithCheck is as below:
>>
>> static public PersistentArrayMap createWithCheck(Object[] init){
>> for(int i=0;i< init.length;i += 2)
>> {
>> for(int j=i+2;j> {
>> if(equalKey(init[i],init[j]))
>> throw new IllegalArgumentException("Duplicate key: " + init[i]);
>> }
>> }
>> return new PersistentArrayMap(init);
>> }
>>
>> The MapReader in LispReader.java seems to pass an Object[] of Strings to
>> PersistentArrayMap/createWithCheck.
>>
>> public static class MapReader extends AFn{
>> public Object invoke(Object reader, Object leftparen, Object opts, Object
>> pendingForms) {
>> PushbackReader r = (PushbackReader) reader;
>> Object[] a = readDelimitedList('}', r, true, opts,
>> ensurePending(pendingForms)).toArray();
>> if((a.length & 1) == 1)
>> throw Util.runtimeException("Map literal must contain an even number of
>> forms");
>> return RT.map(a);
>> }
>>
>> }
>>
>>
>> This behavior is surprising. Is there a reason the map creation process
>> works this way?
>>
>> The above example may seem trivial, since we would have duplicate keys
>> after evaluation as well, but consider the generation of random values:
>>
>> user=> {(java.util.UUID/randomUUID) 1 (java.util.UUID/randomUUID) 2}
>> IllegalArgumentException Duplicate key: (java.util.UUID/randomUUID)
>>  clojure.lang.PersistentArrayMap.createWithCheck
>> (PersistentArrayMap.java:71)
>>
>>
>> --
>> 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 this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> “One of the main causes of the fall of the Roman Empire was that–lacking
> zero–they had no way to indicate successful termination of their C
> programs.”
> (Robert Firth)
>
> --
> 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 this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Literal map keys are checked for duplication before evaluation?

2017-01-04 Thread Timothy Baldridge
The check is made at read-time, by the time to form gets to the compiler
it's already a hash-map and one of your forms will have been dropped. So
the decision was made to make the reader check. One way you could solve
your problem here is with tagged literals, as the literal would be created,
and therefore the UUID would be unique before you even got to the creation
of the hash-map.

http://clojure.org/reference/reader#_tagged_literals

In short though...what should the reader do, it has no clue which of your
two key/value pairs to drop.

On Wed, Jan 4, 2017 at 9:05 PM, Tianxiang Xiong 
wrote:

> Using a Clojure 1.8.0 REPL, I get the following:
>
> user=> {(+ 1 2) 1 (+ 1 2) 2}
> IllegalArgumentException Duplicate key: (+ 1 2)  clojure.lang.
> PersistentArrayMap.createWithCheck (PersistentArrayMap.java:71)
>
> It seems that the a check for key equality is made *before* the key is
> evaluated, when they are still strings.
>
> PersistentArrayMap/createWithCheck is as below:
>
> static public PersistentArrayMap createWithCheck(Object[] init){
> for(int i=0;i< init.length;i += 2)
> {
> for(int j=i+2;j {
> if(equalKey(init[i],init[j]))
> throw new IllegalArgumentException("Duplicate key: " + init[i]);
> }
> }
> return new PersistentArrayMap(init);
> }
>
> The MapReader in LispReader.java seems to pass an Object[] of Strings to
> PersistentArrayMap/createWithCheck.
>
> public static class MapReader extends AFn{
> public Object invoke(Object reader, Object leftparen, Object opts, Object
> pendingForms) {
> PushbackReader r = (PushbackReader) reader;
> Object[] a = readDelimitedList('}', r, true, opts,
> ensurePending(pendingForms)).toArray();
> if((a.length & 1) == 1)
> throw Util.runtimeException("Map literal must contain an even number of
> forms");
> return RT.map(a);
> }
>
> }
>
>
> This behavior is surprising. Is there a reason the map creation process
> works this way?
>
> The above example may seem trivial, since we would have duplicate keys
> after evaluation as well, but consider the generation of random values:
>
> user=> {(java.util.UUID/randomUUID) 1 (java.util.UUID/randomUUID) 2}
> IllegalArgumentException Duplicate key: (java.util.UUID/randomUUID)
>  clojure.lang.PersistentArrayMap.createWithCheck
> (PersistentArrayMap.java:71)
>
>
> --
> 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 this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Literal map keys are checked for duplication before evaluation?

2017-01-04 Thread Tianxiang Xiong
Using a Clojure 1.8.0 REPL, I get the following:

user=> {(+ 1 2) 1 (+ 1 2) 2}
IllegalArgumentException Duplicate key: (+ 1 2)  clojure.lang.
PersistentArrayMap.createWithCheck (PersistentArrayMap.java:71)

It seems that the a check for key equality is made *before* the key is 
evaluated, when they are still strings.

PersistentArrayMap/createWithCheck is as below:

static public PersistentArrayMap createWithCheck(Object[] init){
for(int i=0;i< init.length;i += 2)
{
for(int j=i+2;j {(java.util.UUID/randomUUID) 1 (java.util.UUID/randomUUID) 2}
IllegalArgumentException Duplicate key: (java.util.UUID/randomUUID) 
 clojure.lang.PersistentArrayMap.createWithCheck 
(PersistentArrayMap.java:71)


-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Nightcoders.net, a cloud IDE for ClojureScript

2017-01-04 Thread Zach Oakes
OK it is back up now. Please let me know if you notice any problems -- in 
addition to fixing the Safari issue, I migrated to a server with more 
memory.

On Wednesday, January 4, 2017 at 8:52:17 PM UTC-6, Zach Oakes wrote:
>
> Thanks for the feedback! I fixed the Safari issue and I'm about to take 
> the server down to do another deploy. Hang tight and sorry again to those 
> who are currently on it.
>
> On Wednesday, January 4, 2017 at 10:20:20 AM UTC-6, Zach Oakes wrote:
>>
>> Cloud IDEs are becoming more common. To quote the rifleman's creed, there 
>> are many others like it, but this one is mine:
>>
>> http://nightcoders.net/
>>
>> It's basically a hosted version of Nightlight, running the compiler on my 
>> server so you can build CLJS projects using nothing but a web browser. I'm 
>> aiming at beginners, much like I did with the original Nightcode, but this 
>> time I'm going further by eliminating all setup requirements.
>>
>> Please be gentle with it. I've only been working on this for the past few 
>> weeks while vacationing in mexico...mostly as a distraction while my body 
>> convulsed over the somewhat unhygienic street food I gave it. I spent a lot 
>> of time in the bathroom. That may be oversharing. Oh well.
>>
>> Enjoy!
>>
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Nightcoders.net, a cloud IDE for ClojureScript

2017-01-04 Thread Zach Oakes
Thanks for the feedback! I fixed the Safari issue and I'm about to take the 
server down to do another deploy. Hang tight and sorry again to those who 
are currently on it.

On Wednesday, January 4, 2017 at 10:20:20 AM UTC-6, Zach Oakes wrote:
>
> Cloud IDEs are becoming more common. To quote the rifleman's creed, there 
> are many others like it, but this one is mine:
>
> http://nightcoders.net/
>
> It's basically a hosted version of Nightlight, running the compiler on my 
> server so you can build CLJS projects using nothing but a web browser. I'm 
> aiming at beginners, much like I did with the original Nightcode, but this 
> time I'm going further by eliminating all setup requirements.
>
> Please be gentle with it. I've only been working on this for the past few 
> weeks while vacationing in mexico...mostly as a distraction while my body 
> convulsed over the somewhat unhygienic street food I gave it. I spent a lot 
> of time in the bathroom. That may be oversharing. Oh well.
>
> Enjoy!
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Nightcoders.net, a cloud IDE for ClojureScript

2017-01-04 Thread Paul Gowder
That's really cool!  The autosave is sweet.  So is the fact that I can get 
it to work on ios---I was just thinking about buying an ipad pro and 
figuring out good ways to code on it... this could be a really cool 
solution for starting something on a real computer, leaving it in the 
cloud, working on it on the ipad, etc.  

The oauth doesn't seem to work for me in chrome (on sierra with a ton of 
ad-blockers and such, so that might be giving grief)---I hit the sign in 
button, it pops up the standard google account chooser, I choose an 
account, then the window closes and nothing happens.  But it works in 
safari just fine (with the same double-click issue reported elsewhere in 
this thread). 

Oh, one other little thing I noticed... it's not obvious how to close a 
project and get back to the first screen, like to start on a different 
project.  I ended up just hitting the back button then reload...

This is amazing!

On Wednesday, January 4, 2017 at 10:20:20 AM UTC-6, Zach Oakes wrote:
>
> Cloud IDEs are becoming more common. To quote the rifleman's creed, there 
> are many others like it, but this one is mine:
>
> http://nightcoders.net/
>
> It's basically a hosted version of Nightlight, running the compiler on my 
> server so you can build CLJS projects using nothing but a web browser. I'm 
> aiming at beginners, much like I did with the original Nightcode, but this 
> time I'm going further by eliminating all setup requirements.
>
> Please be gentle with it. I've only been working on this for the past few 
> weeks while vacationing in mexico...mostly as a distraction while my body 
> convulsed over the somewhat unhygienic street food I gave it. I spent a lot 
> of time in the bathroom. That may be oversharing. Oh well.
>
> Enjoy!
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Nightcoders.net, a cloud IDE for ClojureScript

2017-01-04 Thread Luc
Works like a charm from my ipad pro 😁
Luc P.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] New Canvas feature for Proto REPL Charts

2017-01-04 Thread Jason Gilman
Yes, I definitely encourage third-party plugins. Proto REPL is an extension
of the Atom editor. Atom itself can be extended and has great
documentation: https://atom.io/docs

Proto REPL has hooks for extensions which are documented here:
https://github.com/jasongilman/proto-repl/blob/master/extending_proto_repl.md
 The latest hooks that I added are not yet documented there. The new hooks
allow the canvas feature to work and the newest Proto REPL extension, Proto
REPL Sayid  to work.

Depending on what kind of extension you want to build you may or may not
even need to integrate specifically with Proto REPL. It could just be
considered at Atom extension. I'm happy to answer questions here or in the
#protorepl channel of the Clojurians slack.

On Wed, Jan 4, 2017 at 8:47 AM, Aa Dandy  wrote:

> So, proto-repl has plugins but, do you enourage third-party plugins, like
> Light Table did/does?
> For example, can I use linters and hinters, LT Rolex, etc in proto-repl?
> More generally, are the user, default and workspace behaviours exposed for
> amendment?
>
> Regards,
>
> --
> 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 this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/clojure/Eh_6c1xPUdk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Nightcoders.net, a cloud IDE for ClojureScript

2017-01-04 Thread Erik Assum
It seems like I need to double-click on the buttons (like “Web App” and “Game”) 
to make them do something.

MacOS 10.12.3/Safari 10.0.3

Seems to be a safari issue, since it behaves as it should in Chrome.

Erik.

> On 4 Jan 2017, at 17:20, Zach Oakes  wrote:
> 
> Cloud IDEs are becoming more common. To quote the rifleman's creed, there are 
> many others like it, but this one is mine:
> 

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Nightcoders.net, a cloud IDE for ClojureScript

2017-01-04 Thread Zach Oakes
OK I'll look into dealing with that more gracefully.

BTW for those who were just on, I just restarted the server, sorry bout 
that. I needed to improve the confirmation dialog for deleting 
projects/accounts. Eventually i'll figure out how to deploy like the pros 
do...

On Wednesday, January 4, 2017 at 1:08:42 PM UTC-6, Alex Miller wrote:
>
> Ah, it was Ghostery. 
>
> On Wednesday, January 4, 2017 at 1:06:13 PM UTC-6, Zach Oakes wrote:
>>
>> Hmm! Anyone else get that? Can't reproduce even after clearing cache and 
>> whatnot.
>>
>> On Wednesday, January 4, 2017 at 12:59:49 PM UTC-6, Alex Miller wrote:
>>>
>>> Didn't load for me...
>>>
>>> Uncaught TypeError: gapi.load is not a function
>>> at nightcoders.js:513
>>> at nightcoders.js:513
>>>
>>> Did I broke it?
>>>
>>>
>>> On Wednesday, January 4, 2017 at 10:20:20 AM UTC-6, Zach Oakes wrote:

 Cloud IDEs are becoming more common. To quote the rifleman's creed, 
 there are many others like it, but this one is mine:

 http://nightcoders.net/

 It's basically a hosted version of Nightlight, running the compiler on 
 my server so you can build CLJS projects using nothing but a web browser. 
 I'm aiming at beginners, much like I did with the original Nightcode, but 
 this time I'm going further by eliminating all setup requirements.

 Please be gentle with it. I've only been working on this for the past 
 few weeks while vacationing in mexico...mostly as a distraction while my 
 body convulsed over the somewhat unhygienic street food I gave it. I spent 
 a lot of time in the bathroom. That may be oversharing. Oh well.

 Enjoy!

>>>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Nightcoders.net, a cloud IDE for ClojureScript

2017-01-04 Thread Alex Miller
Ah, it was Ghostery. 

On Wednesday, January 4, 2017 at 1:06:13 PM UTC-6, Zach Oakes wrote:
>
> Hmm! Anyone else get that? Can't reproduce even after clearing cache and 
> whatnot.
>
> On Wednesday, January 4, 2017 at 12:59:49 PM UTC-6, Alex Miller wrote:
>>
>> Didn't load for me...
>>
>> Uncaught TypeError: gapi.load is not a function
>> at nightcoders.js:513
>> at nightcoders.js:513
>>
>> Did I broke it?
>>
>>
>> On Wednesday, January 4, 2017 at 10:20:20 AM UTC-6, Zach Oakes wrote:
>>>
>>> Cloud IDEs are becoming more common. To quote the rifleman's creed, 
>>> there are many others like it, but this one is mine:
>>>
>>> http://nightcoders.net/
>>>
>>> It's basically a hosted version of Nightlight, running the compiler on 
>>> my server so you can build CLJS projects using nothing but a web browser. 
>>> I'm aiming at beginners, much like I did with the original Nightcode, but 
>>> this time I'm going further by eliminating all setup requirements.
>>>
>>> Please be gentle with it. I've only been working on this for the past 
>>> few weeks while vacationing in mexico...mostly as a distraction while my 
>>> body convulsed over the somewhat unhygienic street food I gave it. I spent 
>>> a lot of time in the bathroom. That may be oversharing. Oh well.
>>>
>>> Enjoy!
>>>
>>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Nightcoders.net, a cloud IDE for ClojureScript

2017-01-04 Thread Zach Oakes
Hmm! Anyone else get that? Can't reproduce even after clearing cache and 
whatnot.

On Wednesday, January 4, 2017 at 12:59:49 PM UTC-6, Alex Miller wrote:
>
> Didn't load for me...
>
> Uncaught TypeError: gapi.load is not a function
> at nightcoders.js:513
> at nightcoders.js:513
>
> Did I broke it?
>
>
> On Wednesday, January 4, 2017 at 10:20:20 AM UTC-6, Zach Oakes wrote:
>>
>> Cloud IDEs are becoming more common. To quote the rifleman's creed, there 
>> are many others like it, but this one is mine:
>>
>> http://nightcoders.net/
>>
>> It's basically a hosted version of Nightlight, running the compiler on my 
>> server so you can build CLJS projects using nothing but a web browser. I'm 
>> aiming at beginners, much like I did with the original Nightcode, but this 
>> time I'm going further by eliminating all setup requirements.
>>
>> Please be gentle with it. I've only been working on this for the past few 
>> weeks while vacationing in mexico...mostly as a distraction while my body 
>> convulsed over the somewhat unhygienic street food I gave it. I spent a lot 
>> of time in the bathroom. That may be oversharing. Oh well.
>>
>> Enjoy!
>>
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 'encoding-of' for spec

2017-01-04 Thread Alex Miller


On Wednesday, January 4, 2017 at 12:24:38 PM UTC-6, Russell Mull wrote:
>
> I've been hacking on a (currently partial) implementation of a spec 
> combinator I'm currently calling 'encoding-of'. It's pretty common to have 
> some kind of encoded version of a data structure kicking around, in json, 
> xml, or whatever, and it's handy to be able to describe it with spec. 
> That's what this is for. You give it a pair of functions for encoding and 
> decoding and the spec of the 'inner' data, and it glues them together into 
> a spec.  
>
>   (s/def :t/nat-or-float (s/or :nat :t/nat, :float :t/float))
>   (s/def :t/test-map (s/keys :req [:t/nat-or-float]))
>   (s/def :t/stringy-map (encoding-of :t/test-map pr-str read-string))
>
>   (s/conform :t/stringy-map "{:t/nat-or-float 42}")
>   ;; => #t{:nat-or-float [:nat 42]}
>
>   (gen/sample (s/gen :t/stringy-map))
>   ;; => ("#:t{:nat-or-float -1.0}" "#:t{:nat-or-float 0.75}" 
> "#:t{:nat-or-float 2}" "#:t{:nat-or-float -3.0}" "#:t{:nat-or-float 8}" 
> "#:t{:nat-or-float 0}" "#:t{:nat-or-float -0.65625}" "#:t{:nat-or-float 1}" 
> "#:t{:nat-or-float 0}" "#:t{:nat-or-float 3}")
>
>
> The partial implementation is here: 
> https://gist.github.com/e7f8230920225496370ae38fc55f2175
>
> If there's any interest in this, I can clean it up and release it as a 
> standalone library. It necessarily reaches into some of the guts of 
> core.spec, so it may be more suitable as a patch to spec itself, if the 
> maintainers have an appetite for it. 
>

Probably not, thanks.
 

>
> - Russell
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Nightcoders.net, a cloud IDE for ClojureScript

2017-01-04 Thread Alex Miller
Didn't load for me...

Uncaught TypeError: gapi.load is not a function
at nightcoders.js:513
at nightcoders.js:513

Did I broke it?


On Wednesday, January 4, 2017 at 10:20:20 AM UTC-6, Zach Oakes wrote:
>
> Cloud IDEs are becoming more common. To quote the rifleman's creed, there 
> are many others like it, but this one is mine:
>
> http://nightcoders.net/
>
> It's basically a hosted version of Nightlight, running the compiler on my 
> server so you can build CLJS projects using nothing but a web browser. I'm 
> aiming at beginners, much like I did with the original Nightcode, but this 
> time I'm going further by eliminating all setup requirements.
>
> Please be gentle with it. I've only been working on this for the past few 
> weeks while vacationing in mexico...mostly as a distraction while my body 
> convulsed over the somewhat unhygienic street food I gave it. I spent a lot 
> of time in the bathroom. That may be oversharing. Oh well.
>
> Enjoy!
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


'encoding-of' for spec

2017-01-04 Thread Russell Mull
I've been hacking on a (currently partial) implementation of a spec 
combinator I'm currently calling 'encoding-of'. It's pretty common to have 
some kind of encoded version of a data structure kicking around, in json, 
xml, or whatever, and it's handy to be able to describe it with spec. 
That's what this is for. You give it a pair of functions for encoding and 
decoding and the spec of the 'inner' data, and it glues them together into 
a spec.  

  (s/def :t/nat-or-float (s/or :nat :t/nat, :float :t/float))
  (s/def :t/test-map (s/keys :req [:t/nat-or-float]))
  (s/def :t/stringy-map (encoding-of :t/test-map pr-str read-string))

  (s/conform :t/stringy-map "{:t/nat-or-float 42}")
  ;; => #t{:nat-or-float [:nat 42]}

  (gen/sample (s/gen :t/stringy-map))
  ;; => ("#:t{:nat-or-float -1.0}" "#:t{:nat-or-float 0.75}" 
"#:t{:nat-or-float 2}" "#:t{:nat-or-float -3.0}" "#:t{:nat-or-float 8}" 
"#:t{:nat-or-float 0}" "#:t{:nat-or-float -0.65625}" "#:t{:nat-or-float 1}" 
"#:t{:nat-or-float 0}" "#:t{:nat-or-float 3}")


The partial implementation is here: 
https://gist.github.com/e7f8230920225496370ae38fc55f2175

If there's any interest in this, I can clean it up and release it as a 
standalone library. It necessarily reaches into some of the guts of 
core.spec, so it may be more suitable as a patch to spec itself, if the 
maintainers have an appetite for it. 

- Russell

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] Nightcoders.net, a cloud IDE for ClojureScript

2017-01-04 Thread Zach Oakes
Cloud IDEs are becoming more common. To quote the rifleman's creed, there 
are many others like it, but this one is mine:

http://nightcoders.net/

It's basically a hosted version of Nightlight, running the compiler on my 
server so you can build CLJS projects using nothing but a web browser. I'm 
aiming at beginners, much like I did with the original Nightcode, but this 
time I'm going further by eliminating all setup requirements.

Please be gentle with it. I've only been working on this for the past few 
weeks while vacationing in mexico...mostly as a distraction while my body 
convulsed over the somewhat unhygienic street food I gave it. I spent a lot 
of time in the bathroom. That may be oversharing. Oh well.

Enjoy!

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [core.logic] - why doesnt ITake/take* implementation always return a seqable?

2017-01-04 Thread Paulo César Cuneo
Just answering myself found i should bind with choice as it is done in 
reifyg

(defn export [out vs gs]
  (fn [a]
(let [a' (bind a gs)
  as (take* (bind a' (fn [s]
   *(choice (walk* s vs)*
*   empty-f)*)))]
  (bind a (== out as)

On Tuesday, January 3, 2017 at 4:14:20 PM UTC-3, Paulo César Cuneo wrote:
>
> I was hacking around with core.logic, trying to implement a "bind var in 
> sub process".
>
> So that this this succeeds:
> (run [q] 
>(fresh[a]
>   (runsub [q]   ;; will "export 'q" or "bind 'q in 
> caller context"
> [(== a 1) (== q 1)]) ;; 'a will be bound only inside this 
> context 
>   (lvaro a))) ;; 'a is not bind in caller context
> (1)
>
> I didn't want to do term replacement, so i figure i could run goals an 
> return the original substitution.
> (fn[a]
> (let[ a' (take* (reduce bind a goals))]
> (magic-happens q a' a) ;; generate an mplus binding lvar q with a' 
> values inside a.
> )
>
> Anyway :D haha.
>
> I found that, take* throws an exception because 
>
> > (let [x  (lvar) 
>   as (tramp (-> empty-s
>  ((conde [(== x 1)]
>   [(== x 2)]
>   ls (take* as)]
>   ls)
> (#object[clojure.core.logic.Substitutions 0x7c509c4b "{ 
> 1}"]*AbstractMethodError 
>   clojure.lang.RT.seqFrom (RT.java:533)*
> > 
>
> It happens because :
> (deftype Substitutions 
>   
>   ITake
>   (take* [ this ]  this) ;; why not seqable? 
>
> Seems easy to fix, but i bet there be code depending on return not being a 
> seqable.
>   (take* [ this ]  [this]) 
>
> Bye.
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] New Canvas feature for Proto REPL Charts

2017-01-04 Thread Aa Dandy
So, proto-repl has plugins but, do you enourage third-party plugins, like 
Light Table did/does?
For example, can I use linters and hinters, LT Rolex, etc in proto-repl?
More generally, are the user, default and workspace behaviours exposed for 
amendment?

Regards,

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.