Fork me on GitHub
#clojure
<
2019-10-26
>
macrobartfast03:10:53

I'm having trouble getting the threeagent project to run ( https://github.com/DougHamil/threeagent )... I ran 'lein repl' in a terminal, cider-connect'ed from emacs, and when trying to evaluate

(ns threeagent.dev.core
  (:require [threeagent.core :as th]
            ["three" :as three]))
in emacs, getting
Call to clojure.core/ns did not conform to spec:
thoughts? are there additional steps I need to be taking?

macrobartfast04:10:15

I don't know if I should be doing something with figwheel, too... didn't explicitely start that. I'm definitely guessing I've left out a bunch of steps to get this to run.

hiredman04:10:51

"three" in your require is not valid

dominicm09:10:00

To add to the above, it's valid in clojurescript not clojure.

hiredman04:10:22

The only thing allowed there are symbols (which name namespaces) which is why you got that error telling you your call to the ns macro is malformed

macrobartfast04:10:44

definitely in over my head but this is so cool I want to see it work!

hiredman04:10:25

It may be valid clojurescript(the cljs ext means clojurescript not clojure), but lein repl is a clojure reply, not a clojurescript repl

hiredman04:10:52

You may have better luck asking cljs questions in #clojurescript

macrobartfast04:10:40

oookay... just realized I cloned the master branch (the default) and there is a 'release' branch...

hiredman04:10:35

I doubt changing the branch will fix things if you are try to run clojurescript code in a clojure reply, they are different languages that only share a vaguely defined subset of syntax and semantics

hiredman04:10:38

Like trying to paste python into a ruby shell

macrobartfast04:10:41

ah ok just absorbed what you were saying...

macrobartfast04:10:44

although I use figwheel from a terminal launched repl usually via figwheel.

macrobartfast04:10:25

so, in that case, somehow, lein repl leads to cljs happiness, but it's all fuzzy. and your point about #clojurescript is true.

solf08:10:01

How's the status of using graalvm native image with clojure? Any significant gotchas to be aware of?

Jakub Zika09:10:32

Hello everybody, can you recommend me a function that I should use to get these results? I know that problem is the data input to extract-info function. I can't find a right function to use with merge-with to pack all the elements into list ( current implementation creates nested list for every element ) with unique occurences (sets). Thank you

sogaiu09:10:12

<@U7S5E44DB> yes -- i don't know of a nice summary page, iirc, there is some locking-related things and on windows, there appears to be an issue involving _*in_* -- <@U04V15CAJ> knows pretty well, so you might ask him for more specifics. there's also a <#CAJN79WNT|graalvm>, fwiw.

sogaiu10:10:49

it does work pretty well for many things though.

đź‘Ť 4
borkdude16:10:54

why does tools.reader accept multiple :features in a set?

user=> (r/read-string {:read-cond :allow :features #{:clj :cljs}} "[#?(:cljs 1 :clj 2)]")
[1]
user=> (r/read-string {:read-cond :allow :features #{:clj :cljs}} "[#?(:clj 1 :cljs 2)]")
[1]

borkdude16:10:05

what does it mean to support multiple features? and what happens when there are multipe overlapping branches/features?

bronsa16:10:09

It's the same api as clojure.core's, first one in the reader conditional expr wins

bronsa16:10:22

left to right

andy.fingerhut16:10:20

I don't know if this is related, but when reader conditionals were first added to Clojure, before the first official release containing them, they were designed to contain any keywords you wanted, for 'sub platforms', i.e. much more specific than just :clj :cljs :cljr

andy.fingerhut16:10:01

That was pared back to only those choices shortly before the release, in hopes of keeping things simpler for everyone, especially for other tools that parsed Clojure.

borkdude18:10:06

@andy.fingerhut I guess that is related, since most parsers will probably only use one feature at a time and not a multiple?

andy.fingerhut18:10:14

I don't recall the history, but when the feature was originally proposed, it was perhaps necessary for the proposed generality that there be multiple features 'enabled'.

andy.fingerhut18:10:14

The paring back to at most one of :clj :cljs :cljr being enabled, when that restriction was made, perhaps did not cause the developers to change the API to eliminate that generality, so hence a set rather than a single keyword as a parameter.

andy.fingerhut18:10:25

And perhaps they wanted to leave it open for that future generality again, later.

borkdude18:10:37

right, thanks for the comments on this

Alex Miller (Clojure team)18:10:08

The reader, as an independent component, can still take multiple features and do something useful when reading arbitrary code. So that feature still exists and is potentially useful.

Alex Miller (Clojure team)18:10:21

Separately, the reader is used by the language platforms to parse source code for that particular language. In these cases, a “platform” feature is injected when reading source files and that is not currently an open set.

Alex Miller (Clojure team)18:10:04

Doing so is still a possibility in the future but we decided that was a lot of flexibility with a lot of pros and cons and we would leave that decision to a future date

nmkip19:10:13

Hi! One question: Is there a library that can help me with this? I need a function to create an interval N minutes around some timestamp and a function to check if a timestamp is contained in that interval. I tried java-time but the interval function (`http://dm3.github.io/clojure.java-time/java-time.html#var-interval`) doesn't seem to exist anymore. I created some functions to solve this using java-time/instant and interop but I feel I might be doing extra work that a library can do for me.

dominicm19:10:22

Tick has a lot of interval calculus that will help you

nmkip19:10:33

I'll check it

nmkip19:10:35

I'll read the docs and give it a try 🙂 Thanks!

lvh19:10:38

Has anyone used marginalia with clj? There's mostly just a lein plugin. (And a "zi" plugin which appears to be some kind of maven thing.)

seancorfield21:10:53

@lvh Yeah, been a while since I did it tho'...

lvh13:10:46

Thanks! I'll give it a shot.