accessing symbols in local context of a closure

2018-05-24 Thread Sonny To
(defn foo[]
 (let [x  1]
   (fn []  
 (+ x 1)
)
 )

(def bar  (foo))

Is there a way to get the value of x from closure bar?

-- 
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: accessing symbols in local context of a closure

2018-05-24 Thread Alan Thompson
No, it is hidden inside the closure and can't be accessed from the outside.

On Thu, May 24, 2018 at 11:22 AM, Sonny To  wrote:

> (defn foo[]
>  (let [x  1]
>(fn []
>  (+ x 1)
> )
>  )
>
> (def bar  (foo))
>
> Is there a way to get the value of x from closure bar?
>
> --
> 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: Windows Cygwin lein repl

2018-05-24 Thread Alan Thompson
I have used cygwin extensively in the past, but not recently.  If you
haven't tried it yet, you should try installing Git For Windows and then
use the "Git Bash" command shell.
Alan

On Wed, May 23, 2018 at 3:37 AM,  wrote:

> A quick note to anyone coming to this later.  I haven't been able to fix
> this and have reverted back to 2.7.1
>
>
> --
> Kind regards
>
> Stephen
>
> --
> 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: When will the async/await feature in ES8 be introduced in ClojureScript?

2018-05-24 Thread Philos Kim
Refer to https://groups.google.com/forum/#!topic/clojurescript/scUMhU-ctEM 
for discussions.

2018년 5월 24일 목요일 오후 1시 19분 41초 UTC+9, Philos Kim 님의 말:
>
> I wonder when the async/await feature in ES8 will be introduced in 
> ClojureScript.
>
> Of course, I know there is core.async in ClojureScript but I hope that the 
> async/await feature in ES8 will be supported in ClojureScript as soon as 
> possible.
>
> Does anyone know when it will be supported?
>   
>

-- 
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: accessing symbols in local context of a closure

2018-05-24 Thread James Gatannah
On Thursday, May 24, 2018 at 1:22:42 PM UTC-5, Sonny To wrote:
>
> (defn foo[]
>  (let [x  1]
>(fn []  
>  (+ x 1)
> )
>  )
>
> (def bar  (foo))
>
> Is there a way to get the value of x from closure bar?
>

I may be describing this incorrectly.

You're creating a top-level var named bar.

You're calling the function foo, and associating the value it returns to 
that var bar.

foo's return value happens to be a function that looks like it should be a 
counter. Except that, in clojure, it isn't.

This vaguely looks like an approach to lexical closures that I vaguely 
remember from scheme textbooks (and Paul Graham essays).

What are you really trying to 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
--- 
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: Windows Cygwin lein repl

2018-05-24 Thread Sean Corfield
If you’re on Windows 10, I highly recommend trying Windows Subsystem for Linux 
and Ubuntu (or one of the other distros in the Microsoft Store). I do all of my 
Clojure development on Windows that way.

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


From: clojure@googlegroups.com  on behalf of Alan 
Thompson 
Sent: Thursday, May 24, 2018 4:48:58 PM
To: clojure@googlegroups.com
Subject: Re: Windows Cygwin lein repl

I have used cygwin extensively in the past, but not recently.  If you haven't 
tried it yet, you should try installing Git For Windows and then use the "Git 
Bash" command shell.
Alan

On Wed, May 23, 2018 at 3:37 AM, 
mailto:skf.phoe...@gmail.com>> wrote:
A quick note to anyone coming to this later.  I haven't been able to fix this 
and have reverted back to 2.7.1


--
Kind regards

Stephen

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

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