Re: What Emacs framework do you prefer?

2021-08-10 Thread Oleksandr Shulgin
On Tue, Aug 10, 2021 at 4:50 AM Laws  wrote:

> Does anyone want to either recommend a framework or share an init file
> that has some customizations for Clojure?


https://cider.mx/


Cheers,
--
Alex

-- 
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/CACACo5RQ1zbeXnHWS03KBwqG6XcQ2Z0D-6ivELg32RVD-0VayQ%40mail.gmail.com.


State of Clojure/CLR: (was: Scicloj meeting: Nikita Propokov about Skija - graphics in the JVM)

2020-11-17 Thread Oleksandr Shulgin
On Tue, Nov 17, 2020 at 4:56 PM Daniel Slutsky 
wrote:

> https://time.is/1400_08_Dec_2020_in_UTC/
>
> Tonsky has recently released Skija: a library for high-performance
> graphics on the JVM.
> https://tonsky.me/blog/skija/
>
> Of course, this opens some possibilities in Clojure. In this talk, Tonsky
> will present Skija to the Clojure audience.
>

Nice, thanks for sharing!

Can anyone (maybe the author himself) comment on this: C# would do, too,
but it doesn’t have Clojure.
I have never tried it myself, but what is the state of Clojure/CLR
currently?

Regards,
--
Alex

-- 
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/CACACo5TdcN3WDtFX-X6RS8Nmr%3DPKNxjC97Aoj2adQ%3DOA-MMUTw%40mail.gmail.com.


Re: First post: how to mimic a Java List with types?

2020-08-14 Thread Oleksandr Shulgin
On Fri, Aug 14, 2020 at 8:44 PM Jack Park  wrote:

> This idea shows up early in Clojure text books. This concept comes to mind
> rather quickly:
>
> (def and_list (ArrayList.)
>...
> )
>
> But, in the end it is an ArrayList which has an interface-defined
> behavior, e.g. boolean eval(); (from Java)
> Thus far, in a tiny VSCode project, I defined
>
> (definterface IEvaluable
>(^boolean runIt []))
>
> and defined a simple object which will return false and one which will
> return true. I'll use those to populate a conjunctive and a disjunctive
> list.
>
> Now I must define a list object which runs that interface.
>
> Still digging and experimenting, but, on the surface, this approach
> appears to be possible.
>
> From above, as a sketch:
>
> (def and_list (ArrayList.)
>   IEvaluable
>   (runIt [this]
>   ))
> )
>
> Meanwhile, I found this https://clojuredocs.org/clojure.core/proxy-super
> which is now on the table to explore.
>

Nevermind transducers: I've just realized that reduced can be used with the
normal reduce.  E.g. here's short-circuiting AND-reduction fn:

(defn andr
  ([] true)
  ([i] i)
  ([r i] (let [o (and r i)]
   (if o
 o
 (reduced o)

When it comes to the actual lists, it depends how you'd like to represent
them.  E.g. I could imagine something like the following can be a useful
notation:

[:and 1 2 [:or 3 4] 5]

or even more direct:

(quote (and 1 2 (or 3 4) 5))

If you really want an interface-like look and feel, then protocols might be
the right answer:

(defprotocol Evaluable
  (evaluate [this]))

(defrecord AndList [items]
  Evaluable
  (evaluate [this]
(reduce andr (:items this

user> (evaluate (->AndList [1 2 3]))
3
user> (evaluate (->AndList [1 false 3]))
false

To complete it, you'll need to add the OrList and sneak (map evaluate) in
the reduce call in both And- and OrList.

Cheers,
--
Alex

On Fri, Aug 14, 2020 at 3:41 AM Jesús Gómez  wrote:
>
>> Why not to Java-Interop with that Interface and those Classes directly,
>> the same way you use them in Java?
>>
>> El jue., 13 ago. 2020 a las 22:54, Jack Park ()
>> escribió:
>>
>>> The problem:
>>>
>>> In Java, I have an interface *IInferrable* which is basically  boolean
>>> eval();
>>>
>>> Any Java object which extends IInferrable, no matter what it is, will
>>> answer to eval() and return a boolean.
>>> The idea lies at the heart of an inference engine.
>>>
>>> But, I also define a class *AndList* which implements IInferrable and
>>> extends java.util.ArrayList
>>>
>>> So, AndList, and its sibling OrList behave just like a List object, but
>>> also will answer to eval() by running the collection and dealing with what
>>> each element returns when it, too, is eval()'d.
>>>
>>> I'd really love to discover how to pull that off in Clojure.
>>>
>>> Many thanks in advance. -Jack
>>>
>>

-- 
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/CACACo5Rj3U1CJdEy431j7EBpR4oOVccKoGtLjCRPdiKd%3DvgLTQ%40mail.gmail.com.


Re: First post: how to mimic a Java List with types?

2020-08-14 Thread Oleksandr Shulgin
On Fri, Aug 14, 2020 at 9:05 AM Oleksandr Shulgin <
oleksandr.shul...@zalando.de> wrote:

> On Fri, Aug 14, 2020 at 7:51 AM Alexandre Almosni <
> alexandre.almo...@gmail.com> wrote:
>
>> Maybe your objects could be defined by a map containing functions and
>> objects.
>>
>> So exampleAndList = {:fn and, :coll [a b c]}
>>
>>
>> And then eval goes through your objects recursively, using
>>
>> (def eval [o]
>> (apply (:fn o) (map eval (:coll o
>>
>> - with a special case that if o is not a map but say a Boolean you just
>> return itself
>>
>
> A slight problem with that approach is that clojure.core/and is not a
> function, but a macro: the reason being is that it stops evaluating forms
> as soon as it hits a falsey value (similar for "or").
> A smart implementation of And/OrList would like to short-circuit as well I
> guess, so you'll need to express that somehow.
>
> Of the clojure.core library that property is satisfied by transducers:
> https://clojure.org/reference/transducers#_early_termination
>

I came up with the following:

;; and-transducer with early termination:
 (defn xand [rf]
   (fn
 ([] (rf))
 ([res] (rf res))
 ([res inp] (if inp
  (rf res inp)
  (reduced inp)

;; reducing function implementing and:
  (defn andr
   ([] true)
   ([i] i)
   ([r i] (and r i)))

;; noisy variant of get:
 (defn noisy-get
  ([k]
   (fn [m]
 (noisy-get m k)))
  ([m k]
   (println "noisy-get" m k)
   (get m k)))

;; all in action:
user> (def xf (comp (map (noisy-get :data))
xand))
#'user/xf
user> (transduce xf andr [{:data 1} {:data false} {:no-data 3}])
noisy-get {:data 1} :data
noisy-get {:data false} :data
false
user> (transduce xf andr [{:data 1} {:data 2} {:no-data 3} {:data 4}])
noisy-get {:data 1} :data
noisy-get {:data 2} :data
noisy-get {:no-data 3} :data
nil
user> (transduce xf andr [{:data 1} {:data 2} {:data 3} {:data 4}])
noisy-get {:data 1} :data
noisy-get {:data 2} :data
noisy-get {:data 3} :data
noisy-get {:data 4} :data
4

It does feel a bit redundant to have the reducing function on top of a
transducer that accomplishes mostly the same, but I haven't found a way to
make it shorter.

Cheers,
--
Alex

> On 14 Aug 2020, at 02:24, Jack Park  wrote:
>>
>> 
>> The problem:
>>
>> In Java, I have an interface *IInferrable* which is basically  boolean
>> eval();
>>
>> Any Java object which extends IInferrable, no matter what it is, will
>> answer to eval() and return a boolean.
>> The idea lies at the heart of an inference engine.
>>
>> But, I also define a class *AndList* which implements IInferrable and
>> extends java.util.ArrayList
>>
>> So, AndList, and its sibling OrList behave just like a List object, but
>> also will answer to eval() by running the collection and dealing with what
>> each element returns when it, too, is eval()'d.
>>
>> I'd really love to discover how to pull that off in Clojure.
>>
>>

-- 
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/CACACo5TDpMg_CEhE2ytwZv9R1L3%3DifayFLYTs6KC80vON59hiw%40mail.gmail.com.


Re: First post: how to mimic a Java List with types?

2020-08-14 Thread Oleksandr Shulgin
On Fri, Aug 14, 2020 at 7:51 AM Alexandre Almosni <
alexandre.almo...@gmail.com> wrote:

> Maybe your objects could be defined by a map containing functions and
> objects.
>
> So exampleAndList = {:fn and, :coll [a b c]}
>
>
> And then eval goes through your objects recursively, using
>
> (def eval [o]
> (apply (:fn o) (map eval (:coll o
>
> - with a special case that if o is not a map but say a Boolean you just
> return itself
>

A slight problem with that approach is that clojure.core/and is not a
function, but a macro: the reason being is that it stops evaluating forms
as soon as it hits a falsey value (similar for "or").
A smart implementation of And/OrList would like to short-circuit as well I
guess, so you'll need to express that somehow.

Of the clojure.core library that property is satisfied by transducers:
https://clojure.org/reference/transducers#_early_termination

Regards,
--
Alex

On 14 Aug 2020, at 02:24, Jack Park  wrote:
>
> 
> The problem:
>
> In Java, I have an interface *IInferrable* which is basically  boolean
> eval();
>
> Any Java object which extends IInferrable, no matter what it is, will
> answer to eval() and return a boolean.
> The idea lies at the heart of an inference engine.
>
> But, I also define a class *AndList* which implements IInferrable and
> extends java.util.ArrayList
>
> So, AndList, and its sibling OrList behave just like a List object, but
> also will answer to eval() by running the collection and dealing with what
> each element returns when it, too, is eval()'d.
>
> I'd really love to discover how to pull that off in Clojure.
>
>

-- 
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/CACACo5SqECEzLU-4VBBvB8J6xdi%3DqRpoqLjR4urhq7TBiB3mXA%40mail.gmail.com.


Re: first time without state - and I'm lost

2020-06-16 Thread Oleksandr Shulgin
On Mon, Jun 15, 2020 at 7:34 PM Ernesto Garcia  wrote:

> Hi, it's a long time that this question was posted, but I have found it
> interesting in the implementation of token refreshes.
>
> First of all, for service invocation, given a `revise-oauth-token` method,
> I think this is good client code:
>
> (http/request
>   {:method :get
>:url "https://example.com/;
>:oauth-token (revise-oauth-token token-store)})
>
> If you find it too repetitive or fragile in your client code, you can make
> a local function, but I wouldn't abstract the service invocation at a
> higher layer.
>
> Regarding the implementation of the token store, we could initially think
> of a synchronized store, like an atom, and `revise-oauth-token` would swap
> its content when a refresh is required. This is inconvenient for
> multithreaded clients, because there could be several refresh invocations
> going on concurrently.
>
> In order to avoid concurrent refreshes, I propose to implement the token
> store as an atom of promises. Implementation of `revise-oauth-token` would
> be:
>
> (defn revise-oauth-token [token-store]
>   (:access_token
> @(swap! token-store
>(fn [token-promise]
>  (if (token-needs-refresh? @token-promise (Instant/now))
>(delay (refresh-oauth-token (:refresh_token @token-promise)))
>token-promise)
>
> Note that using a delay avoids running `refresh-oauth-token` within the
> `swap!` operation, as this operation may be run multiple times.
> Also note that `token-needs-refresh` takes an argument with the present
> time. This keeps the function pure, which could help for unit testing, for
> example.
>
> There is an alternative implementation using `compare-and-set!` that
> avoids checking `token-needs-refresh?` several times, but it is more
> complicated. I have posted full sample code in a gist:
> https://gist.github.com/titogarcia/4f09bcc5fa38fbdc1076954b9a99a8fc
>

I think it is worth mentioning an alternative approach to avoid concurrent
token refresh may be to use a scheduled task to run shortly before the
currently valid token is going to expire.
The http call then only needs deref and the background task can even use
reset! on the atom, as there are no concurrent update operations to race
against.

--
Alex

-- 
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/CACACo5TMJPt8CNbk0DS2z%3D%2BVsnadMNRH%3DdPPX%3DBGePWkdRBYXg%40mail.gmail.com.


Re: Strange with "clj" tool

2019-07-31 Thread Oleksandr Shulgin
On Wed, Jul 31, 2019 at 1:16 PM ru  wrote:

>
> The tool "clj" starts normally in any folder, except in one, that I cloned
> from github:
>
> [image: error.png]
>
>
> Please, explain me this behavior.
>
Do you by chance have some non-absolute path in your PATH environment
variable in that shell session?  Something like "bin" or "." ?

I also wonder if you are intentionally stopping the prompts of clj
invokations that did work (using Ctrl+Z?) instead of making them exit (by
sending EOF: Ctrl+D)?

--
Alex

-- 
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/CACACo5TKpkWODZVgRGh%3DNdFS4JiwLWrkjOV3qfR6OrLj0da_6w%40mail.gmail.com.


Re: Brl-cad with clojure

2019-07-09 Thread Oleksandr Shulgin
On Tue, Jul 9, 2019 at 10:35 AM Vikram Shaw  wrote:

> I want to create a Brl-cad project using Clojure programming language in
> which I can create a database and some solid figure like sphere.
> I have written the code using ``sh`` clojure function but getting error.
> The ``sh`` function is working fine as I have checked in repl.
> This is the code I'm using:
> *(ns brl-cad.core*
> *(:require [clojure.java.shell :refer [sh]]))*
>
> *(defn example []*
> *(println (:out (sh "-c" "./mged" "test.g"*
>
> I have added the mged path also: 
> */usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:Applications/BRL-CAD\
> \:\ MGED\ 7.24.0.app/Contents/Resources/rel-7.24.0/bin:/opt/X11/bin*
>
> Error which I'm getting: *Execution error (IOException) at
> java.lang.ProcessImpl/forkAndExec (ProcessImpl.java:-2).*
> *error=2, No such file or directory*
>
> I am using Mac OSX.
> I'm having problem with creating database and solid figure like sphere.
>

Hi,

This doesn't seem to be a Clojure-specific question or a question about
"creating a database and a solid figure".

You are trying to run mged binary, but it's not in the current directory of
the process that runs your Clojure program apparently.

If it's on the PATH, then you should run it w/o prefixing the command with
"./" (this instructs to look in the current directory and ignores the
search paths).  If the mged binary is installed at "/Applications/BRL-CAD\
\:\ MGED\ 7.24.0.app/Contents/Resources/rel-7.24.0/bin" on your system,
then you should make sure to include the leading forward slash in your PATH
definition for it to be found.

I would recommend trying to make it work outside of your Clojure program
first, before trying to run it with functions from clojure.java.shell
namespace.

Cheers,
--
Alex

-- 
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/CACACo5SNpqTnhgd8OR61XgKaV7BovMGyR6AMS30XSSKjEBNnww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] seancorfield/next.jdbc 1.0.0

2019-06-13 Thread Oleksandr Shulgin
On Thu, Jun 13, 2019 at 7:51 AM Sean Corfield  wrote:

> The first “gold” release of the next generation of clojure.java.jdbc – a
> new low-level Clojure wrapper for JDBC-based access to databases!
>
>
>
> https://github.com/seancorfield/next-jdbc
>
>
>
> Compared to the release candidate, this contains just a couple of
> usability additions. The API has been stable since Beta 1 and only
> accretive/fixative changes will be made. Read more about the release:
> https://clojureverse.org/t/next-jdbc-1-0-0-the-gold-release/4379
>
>
>
> Official documentation on the excellent cljdoc.org:
> https://cljdoc.org/d/seancorfield/next.jdbc
>

> After a month of alpha builds being available for testing, the first beta
build was released on June 24th, 2019.

/me looks at his pocket clock distrustfully ;)

Love the datafy/nav support out of the box, but a bit confused by the
function name "plan" (especially together with prepared statements).  Do
you happen to have any piece of discussion that lead to this choice of name?

Regards,
--
Alex

-- 
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/CACACo5R90Q_HSc_MxMNGwLq0_umCfzbesvphUmMXKTQRB9SxYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Await on agent triggers watch functions

2019-01-07 Thread Oleksandr Shulgin
On Mon, Jan 7, 2019 at 5:26 PM Herwig Hochleitner 
wrote:

> Am Mo., 7. Jan. 2019 um 11:20 Uhr schrieb Oleksandr Shulgin <
> oleksandr.shul...@zalando.de>:
>
>>
>> Is it intended that calling `await` on an agent triggers the watch
>> functions?
>>
>> From the implementation side I can see why this is the case, but cannot
>> find if this is documented as intended behavior:
>> https://github.com/clojure/clojure/blob/ee3553362de9bc3bfd18d4b0b3381e3483c2a34c/src/clj/clojure/core.clj#L3274
>>
>> For one, it doesn't seem like waiting for an agent involves change in it
>> state in any way.
>>
>> I don't think that this behavior is explicitly intended, but I don't
> think that it's faulty either.
>

> I'd argue that any watcher function should be robust towards being
> triggered without changes:
>
> 1) (send a identity) should always be a no-op without any hidden
> implications. That's important, so that any agent function will be able to
> decide to do nothing.
>

I understand and agree with that.  I also see that the add-watch
documentation says that the watch functions are called "whenever the
reference's state *might* have been changed", but I just wonder if this is
worth documenting.  Unless it's considered to be merely an implementation
detail which is subject to change.

Thanks,
--
Alex

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


Await on agent triggers watch functions

2019-01-07 Thread Oleksandr Shulgin
Hello,

Is it intended that calling `await` on an agent triggers the watch
functions?

user> (defn watch1 [& args] (apply println args))
#'user/watch1
user> (def a1 (agent nil))
#'user/a1
user> (add-watch a1 :w1 watch1)
#agent[{:status :ready, :val nil} 0x267236ca]
user> (send a1 (constantly 1))
#agent[{:status :ready, :val 1} 0x267236ca]
:w1 #agent[{:status :ready, :val 1} 0x267236ca] nil 1
user> (await a1)
:w1 #agent[{:status :ready, :val 1} 0x267236ca]
nil
user>  1 1

>From the implementation side I can see why this is the case, but cannot
find if this is documented as intended behavior:
https://github.com/clojure/clojure/blob/ee3553362de9bc3bfd18d4b0b3381e3483c2a34c/src/clj/clojure/core.clj#L3274

For one, it doesn't seem like waiting for an agent involves change in it
state in any way.

Regards,
-- 
Alex

-- 
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] Learn ClojureScript and Reagent; learnreagent.com

2018-06-28 Thread Oleksandr Shulgin
On Thu, Jun 28, 2018 at 7:10 AM  wrote:

> I believe that the ideas in Clojure/ClojureScript are really great and
> need bigger adoption in web dev, this is why I created a video course to
> teach ClojureScript and Reagent.
>
> To make sure this course teaches best practice it has been reviewed by
> Juho Teperi, Thomas Heller, and Daniel Compton.
>
> The course is divided in two tiers:
>
> *Free* - first 12 HD videos which will get you quite far! It covers
> everything from dev setup to building components with SPA.
>
> *Pro* - everything in free + additional 18 HD videos that go over AJAX
> requests, npm and JS interop wiht shadow-cljs, using BaaS (Firebase) and it
> goes all the way down to deployment.
>

That's really nice, thank you!  I've already started watching the free one.

What's missing, from my point of view is testing setup.  I've checked the
list of Pro episodes and didn't find it there either.

Did you omit testing intentionally or do you have plans to extend the
course later?

Thanks,
--
Alex

-- 
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: Terminating 'clj' REPL session

2017-12-11 Thread Oleksandr Shulgin
On Sat, Dec 9, 2017 at 11:37 PM, Alan Thompson  wrote:

> Hi - Just downloaded the new Clojure 1.9.0 package.  When I tried the repl
> I noticed that it doesn't respond to either `exit` or `quit` as one might
> expect from the lein repl:
>
> ~/cool/tools > clj
> Clojure 1.9.0
> user=> (+ 2 3)
> 5
> user=> exit
> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
> exit in this context, compiling:(NO_SOURCE_PATH:0:0)
> user=>
> user=> quit
> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
> quit in this context, compiling:(NO_SOURCE_PATH:0:0)
> user=> ^D
> ~/cool/tools >
>
>
> Lein repl for comparison:
>
> ~/tupelo > lein repl
> nREPL server started on port 37115 on host 127.0.0.1 - Clojure 1.9.0
> tupelo.core=> exit
> Bye for now!
>
> ~/tupelo >
>
> ~/tupelo > lein repl
> nREPL server started on port 40639 on host 127.0.0.1 - Clojure 1.9.0
> tupelo.core=> quit
> Bye for now!
> ~/tupelo >
>
>
> The new repl does terminate upon CRTL-D or CRTL-C, but many users will
> probably be confused that `quit` and `exit` are not accepted.
>

To recap, my lein repl starts with the following help banner:

Docs: (doc function-name-here)
  (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

That doesn't suggest that `exit` alone without the function call is going
stop the main loop.

The problems begin when one tries to use it in the middle of an unfinished
s-expr, a primary reason could be that the user doesn't understand the
changed prompt:

user=> (+ 1
  #_=> exit
  #_=> )

CompilerException java.lang.RuntimeException: Unable to resolve symbol:
exit in this context, compiling:(/tmp/form-init4088985676787273132.clj:1:1)

Actually, a more likely scenario is like this:

user=> (+ 1
  #_=> exit
  #_=> quit
  #_=> help
  #_=> why are you doing this to me?

Nor does (exit) call works, which is contrary to the help doc:

user=> (+ 1
  #_=> (exit))

CompilerException java.lang.RuntimeException: Unable to resolve symbol:
exit in this context, compiling:(/tmp/form-init4248691177104478700.clj:2:1)

An interesting thing is the same issue is discussed currently on the
PostgreSQL mailing list about behavior of psql:


https://www.postgresql.org/message-id/flat/94e59791-e788-4ebb-80a9-9c871ff5df64%40manitou-mail.org

In particular, the following suggestion seems to provide a reasonable way
out of this problem:


https://www.postgresql.org/message-id/flat/94e59791-e788-4ebb-80a9-9c871ff5df64%40manitou-mail.org#1735.1512761160%40sss.pgh.pa.us

Not sure if this can be done with Clojure, short of employing reader macros
in some way?

Cheers,
--
Alex

-- 
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] Cambium - Structured logging for Clojure

2017-12-01 Thread oleksandr . shulgin
On Thursday, November 30, 2017 at 3:35:24 PM UTC+1, Shantanu Kumar wrote:
>
>
> I am happy to announce the availability of Cambium, an Open Source project 
> for structured logging in Clojure using SLF4j and Logback.
>
> Details: https://cambium-clojure.github.io/
> Repos: https://github.com/cambium-clojure
>

Looks nice, thank you for sharing!  I've got a number of questions:

1) Is it possible to include example output for FlatJsonLayout in the 
documentation?
2) Given that it uses SLF4J, I guess it can also work with 
java.util.logging?
3) How exception messages are logged: in or outside of the context?
4) Are clojure.lang.ExceptionInfo exceptions printed with the data map?  
>From what I've seen previously, only java.util.logging uses .toString() on 
exception object which results in message *and* data, the rest of logging 
backends use only .getMessage() for some reason, completely missing the 
data from the log message.

Cheers!
--
Alex

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