Re: ClojureScript repl over proxy

2021-04-22 Thread Lars Rune Nøstdal
Hi,
I would stick with SSH tunnels for this tbh.. Because once you fix this 
particular issue right here, there's 2-3 similar issues showing up in 2-4 
months; who knows. I use a tiny bash script in each project that deals with 
the particular ports needed.

mvh, L

On Wednesday, April 21, 2021 at 8:40:35 PM UTC+3 rv.m...@gmail.com wrote:

> Hi,
>
> I'm using a cloud development platform (Gitpod) and it automatically 
> creates proxy from public URL to localhost, so you can develop a web 
> application from cloud and see the result. I'm trying to run cljs REPL, but 
> it fails to connect because it tries to connect to the REPL on 
> `localhost:9090` which is not accessible from outside because I use public 
> URL in a browser.
>
> I have looked at the code and looks like HOST and PORT in browser 
> hard-coded
>
> https://github.com/clojure/clojurescript/blob/a4673b880756531ac5690f7b4721ad76c0810327/src/main/cljs/clojure/browser/repl.cljs#L31
>  
> but still maybe I have missed something, and it's possible to set up REPL 
> for my use case. So would be glad to any response
>
> Thanks
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/f258d0ee-fcbe-4918-8426-673fe28054a0n%40googlegroups.com.


Re: Clojure, JVM and/or ASM bug?

2019-02-06 Thread Lars Rune Nøstdal


On Wednesday, February 6, 2019 at 5:15:53 PM UTC+2, Alex Miller wrote:
>
> I think the condition here means that the loop compilation can't tell that 
> the s local is definitely out of scope and can be cleared, so you end up 
> holding the head.
>
> While there is some analysis here, we're not doing inference level stuff 
> on the "if false" to knock out branches etc and generally that's not the 
> kind of thing we try to do.
>

I.e. WONTFIX? Using lazy sequences is or can be pretty dangerous without 
plenty and frequent testing, then -- since "don't hold onto the head" means 
one will have to take into account whatever code the compiler and/or 
libraries (c.c.async?) may or may not generate behind the scenes based on 
subtleties. 

H ...anyway, I'll try to work around this; perhaps by avoiding lazy 
sequences altogether. For me switching to clojure.core.async and doing 
something like this *seems* to have worked (perhaps useful for others who 
find this thread later):

   - wrap the range (or infinite or long sequence really) in a *source* chan 
   <https://clojuredocs.org/clojure.core.async/chan>.
   - do the transformation in a *middle* chan; noting that the chan Fn 
   takes an xform arg.
   - pipe <https://clojuredocs.org/clojure.core.async/pipe> the *middle* chan 
   to your final *output* chan. something like: *(async/pipe 
   (handle-source-chan (async/chan 1000 xform) ...) output-chan)*

...it's a bit tricky to setup -- but yeah; no leaks here for now. It's 
interesting that I have a sort of more explicit buffer in the *middle* chan 
I can fiddle around with too now!

Mvh, Lars

 

>
>
> On Wednesday, February 6, 2019 at 7:57:57 AM UTC-6, Lars Rune Nøstdal 
> wrote:
>>
>> Hi, so I've been staring at this for hours :
>>
>>
>> (defn foo []
>>   (let [s (range)]
>> (if false
>>   nil
>>   (future
>> (loop [s s]
>>   (recur (rest s)))
>>
>>
>> ...if I run this I run out of heap space quite fast on any of these:
>>
>>- Clojure: "1.11.0-master-SNAPSHOT", 1.9.0, 1.8.0 or 1.7.0
>>- OpenJ9 0.12.1 or Oracle 11.0.2 2018-10-16 LTS
>>
>>
>> ..that's what I have at hand for testing for now. If I remove the FUTURE 
>> or place it higher up the stack it doesn't happen. I looked at a heap dump 
>> in MAT and it seems to contain millions of empty stack frames or binding 
>> frames (conveyor?); all held together by circular references (AFAICT).
>>
>> -- 
>> Mvh, Lars Rune Nøstdal
>> https://www.quanto.ga/
>>
>>

-- 
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.


Clojure, JVM and/or ASM bug?

2019-02-06 Thread Lars Rune Nøstdal
Hi, so I've been staring at this for hours :


(defn foo []
  (let [s (range)]
(if false
  nil
  (future
(loop [s s]
  (recur (rest s)))


...if I run this I run out of heap space quite fast on any of these:

   - Clojure: "1.11.0-master-SNAPSHOT", 1.9.0, 1.8.0 or 1.7.0
   - OpenJ9 0.12.1 or Oracle 11.0.2 2018-10-16 LTS


..that's what I have at hand for testing for now. If I remove the FUTURE or 
place it higher up the stack it doesn't happen. I looked at a heap dump in 
MAT and it seems to contain millions of empty stack frames or binding 
frames (conveyor?); all held together by circular references (AFAICT).

-- 
Mvh, Lars Rune Nøstdal
https://www.quanto.ga/

-- 
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] nREPL 0.4.5 released!

2018-09-03 Thread Lars Rune Nøstdal
Hi,
I still get this when I do `cider-jack-in`: 
   ;; CIDER 0.18.0 (package: 20180902.1638) (Saigon), nREPL 0.2.13


..I've removed all mentions of "nrepl" in package.clj, but it seems lein (I 
think?) still loads the old 0.2.13 version.

Thanks for your work on this stuff by the way; it's fantastic!

mvh,
Lars

-- 
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] Clojure 1.8.0-beta1

2015-10-13 Thread Lars Rune Nøstdal
Just a heads up that http://dev.clojure.org/jira/browse/CLJ-1809 is still a 
problem. A lot of Clojure code fails to compile now. I hope this will be 
fixed before 1.8 final is out.

On Tuesday, October 13, 2015 at 4:01:06 PM UTC+2, Alex Miller wrote:
>
> Clojure 1.8.0-beta1 is now available.
>
> Try it via
>
>- Download: 
>https://repo1.maven.org/maven2/org/clojure/clojure/1.8.0-beta1
>- Leiningen: [org.clojure/clojure "1.8.0-beta1"]
>
> Below is a list of the other changes included in beta1. See the full 
> change log here: https://github.com/clojure/clojure/blob/master/changes.md
> .
>
>
>- CLJ-1456  Compiler now 
>errors if too few or too many arguments to throw
>- CLJ-1282  quote now 
>throws if passed more or less than one arg
>- CLJ-1210  Improved 
>error message for (clojure.java.io/reader nil)
>- CLJ-1414  sort and 
>sort-by now indicate sort is stable in docstring
>- CLJ-1765  areduce 
>performance improvements
>- CLJ-1724  Remove 
>unnecessary call to seq() in LazySeq.hashCode()
>- CLJ-1295  Improved 
>array-map dissoc performance
>- CLJ-1277  Speed up 
>printing of time instants with type hints
>- CLJ-1259  Speed up 
>pprint and cl-format with type hints
>- CLJ-668  Improve slurp 
>performance by using StringWriter and jio/copy
>- CLJ-1810  ATransientMap 
>now marked public
>- CLJ-1653  str of an 
>empty list should be "()"
>- CLJ-1567  Removed 
>unused local in condp implementation
>- CLJ-1351  Unused 
>swapThunk method was being emitted for fns with keyword callsites
>- CLJ-1329  Removed 
>unused local in PersistentVector.cons()
>- CLJ-1380  3-arg 
>ExceptionInfo constructor permitted nil data
>- CLJ-1226  set! of a 
>deftype field using field-access syntax caused ClassCastException
>
>

-- 
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.


clojure 1.8 java.lang.VerifyError method: invokeStatic signature: Can only throw Throwable objects

2015-10-01 Thread Lars Rune Nøstdal
Hi,
Anyone playing around with 1.8 from Git? It has problems compiling this for 
some reason:

(defn blah []
  (let [a (atom nil)
b nil]
(try
  (println "hi")
  (catch Throwable e
(println e))
  (finally
(when (and (deref a) b)
  (println "huh"))

-- 
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: clojure 1.8 java.lang.VerifyError method: invokeStatic signature: Can only throw Throwable objects

2015-10-01 Thread Lars Rune Nøstdal


On Thursday, October 1, 2015 at 12:59:39 PM UTC+2, Nicola Mometto wrote:
>
>
> http://dev.clojure.org/jira/browse/CLJ-1809 
>

Awesome; thank you.

-- 
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]: clj.jdbc 0.1-beta1 - Alternative implementation of jdbc wrapper for clojure.

2013-11-29 Thread Lars Rune Nøstdal
Looks interesting. It even has the issue tracker on github still enabled.

-- 
-- 
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/groups/opt_out.


defonce is not thread safe (racy)

2012-01-12 Thread Lars Rune Nøstdal
Hi,
defonce is not thread safe (racy).

-- 
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

Re: Quartz and Clojure

2011-12-07 Thread Lars Rune Nøstdal
You've probably found this by now, but there's: 
https://github.com/mdpendergrass/quartz-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 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

Re: Downloading the documentation?

2011-11-13 Thread Lars Rune Nøstdal
The Clojure gh-pages branch contains the API docs, but as far as I can tell 
it doesn't contain the stuff found on clojure.org.

-- 
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

Re: where can I find the official statement about changes from 1.2 to 1.3?

2011-10-10 Thread Lars Rune Nøstdal
https://github.com/clojure/clojure/blob/1.3.x/changes.txt I think.

-- 
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

Getting Slime to catch exceptions from spawned threads

2011-08-31 Thread Lars Rune Nøstdal
How does one go about getting Slime to catch exceptions from spawned 
threads:

user (.start (Thread. (fn [] (/ 42 0   

The above exception ends up outside of Slime now; back in the terminal 
where `lein swank' was started.

I tried using a future also, but it has some properties I don't understand. 
This does not show an exception, even though the divide by zero must have 
happened(?):

user (let [it (future (/ 42 0))]
(Thread/sleep 100)
(println (realized? it)))
true
nil


..this does show the excpetion, but late:

user (let [it (future (/ 42 0))]
(Thread/sleep 100)
(println (realized? it))
(deref it))
true
; Evaluation aborted.


Agents catches exceptions within themselves for extraction later, but that 
isn't suitable in my current case.

-- 
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

Re: Lein uberjar hangs when swank is required in the namespace.

2011-08-25 Thread Lars Rune Nøstdal
It's hanging here too, but I have no idea why; I'm not including swank.

Is there any verbose mode for lein?

-- 
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

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-28 Thread Lars Rune Nøstdal
.. but isn't jQuery and ExtJS totally different things?

-- 
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

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Lars Rune Nøstdal
I'd say Google Closure/Libray is more idiomatic JavaScript than jQuery; 
jQuery is more sugary and has a different feel to it.

I like jQuery, but I completely see why that is not a the most optimal base 
to build on when something like Google Closure exists. Rich mentioned, 
however, that people would probably wrap or include jQuery as a plugin 
anyway, i.e. not as a base thing, and this is ok and a much better strategy 
IMHO.

I didn't really understand your post about Yegge either.

-- 
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

Clojure + PostgreSQL

2011-06-26 Thread Lars Rune Nøstdal
Hi guys,
Anyone using Clojure and PostgreSQL? I'm trying to access PostgreSQL 
using https://github.com/clojure/java.jdbc at the moment, but it seems to 
have trouble with simple inserts:

   (insert-record :temp {:parent 42}) 
  #PSQLException org.postgresql.util.PSQLException: A result was returned 
when none was expected.


..etc.. Perhaps I'm on the wrong track; what do you guys use or do?

-- 
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

Re: Clojure + PostgreSQL

2011-06-26 Thread Lars Rune Nøstdal
Quick change to do-prepared* in internal.clj:



(defn do-prepared*
  Executes an (optionally parameterized) SQL prepared statement on the
  open database connection. Each param-group is a seq of values for all of
  the parameters.
  [return-keys sql  param-groups]
  (with-open [stmt (if return-keys
 (.prepareStatement (connection*) sql 
java.sql.Statement/RETURN_GENERATED_KEYS)
 (.prepareStatement (connection*) sql))]
(if return-keys
  (do
(doseq [param-group param-groups]
  (dorun (map-indexed (fn [index value]
(.setObject stmt (inc index) value))
  param-group)))
(transaction* (fn []
(.executeUpdate stmt)
(first (resultset-seq* (.getGeneratedKeys stmt))
  (do
(doseq [param-group param-groups]
  (dorun (map-indexed (fn [index value]
(.setObject stmt (inc index) value))
  param-group))
  (.addBatch stmt))
(transaction* (fn []
(let [rs (seq (.executeBatch stmt))]
  (if return-keys (first (resultset-seq* 
(.getGeneratedKeys stmt))) rs




 (with-connection db
(insert-record :temp {:parent (rand 42)}))
{:id 88, :parent 13}

 (with-connection db
(insert-records :temp {:parent (rand 42)} {:parent (rand 
42)}))
({:id 89, :parent 7} {:id 90, :parent 33})

 




This probably breaks something else though; I haven't tested ...

-- 
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

Re: Applying Java functions

2011-06-18 Thread Lars Rune Nøstdal
Hi,

user (definline sqrt [x]
`(Math/sqrt ~x))
#'user/sqrt

user (map sqrt (range 1 10))
(1.0 1.4142135623730951 1.7320508075688772 2.0 2.23606797749979 
2.449489742783178 2.6457513110645907 2.8284271247461903 3.0)

-- 
http://www.nostdal.org/

-- 
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