This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-07
Channels
- # babashka (17)
- # beginners (33)
- # calva (9)
- # cider (2)
- # clj-kondo (17)
- # cljs-dev (2)
- # cljsrn (2)
- # clojars (3)
- # clojure (60)
- # clojure-australia (2)
- # clojure-europe (8)
- # clojure-gamedev (5)
- # clojurescript (27)
- # cursive (2)
- # emacs (9)
- # fulcro (8)
- # gratitude (5)
- # lsp (41)
- # malli (3)
- # meander (18)
- # pathom (5)
- # polylith (25)
- # re-frame (17)
- # reagent (1)
- # rewrite-clj (6)
- # shadow-cljs (11)
- # uncomplicate (5)
- # vim (6)
- # web-security (5)
How do you add elements to both the end and front of a seq. I saw a trick:
(flatten [1 some-vec 1])
which adds 1 to both end and beginning. Another approach would be
(concat [1] some-vec [1])
Is there any better approach other than the above two?Just regarding concat, it's not exactly cheapest. It has some implementation details which actually give it nasty overhead and a nasty tendency to realize lazy arguments
To add elements to the end of a vector you can just use conj. More information about your use case would help
Hi all. I’m tempted to try tinkering with a very trivial “https://roamresearch.com/” clone. Would reframe be a good choice?
Not that I know of. It would probably look like a compiler pass on the AST. Do you have access to the AST before the problematic code is emitted?
no I mean some cider refactor etc. I already use the one to add arities to function and such
sounds like making a naive "combine these 2 lets into one" would be easy also sounds like a symbol-aware one (make sure one var is not used before another) is hard but maybe a naive one, paired with clj-kondo would be easy. clojure-LSP has some fun things. And integrates nicely with clj-kondo I think smash-lets-together is not yet a feature
I'm doing clojure web development. I'm trying to do authentication. The header setup I've chosen works when the backend server is node.js, but it doesn't work with Clojure's ring. I am able to deliver cookies to the client when the request comes from one of the webpages served from clojure's backend port but it will not issue cookies to requests that come from a different port on localhost. The headers Access-Control-Allow-Credentials = "true" , Access-Control-Allow-Methods is set to "*", Access-Control-Allow-Origin is set to localhost:<the port of the frontend, not clojure>, and "Access-Control-Allow-Headers" is set to "x-requested-with, content-type". Even after making those modifications, clojure still will not serve up a cookie to the frontend.
My partner discovered it was an issue with the JS frontend. Thank you for listening.
is this is good one to learn clojure and web development : http://www.parens-of-the-dead.com/e1.html ?
There is a web development book to. But as a intro im sure that's fine. Web dev is bigger then cljs
This book is free https://www.learn-clojurescript.com/ but I'm not too sure how good it is compared to the Web Development with Clojure book
When using lein uberjar
what’s the difference between the SNAPSHOT-standalone.jar and the SNAPSHOT.jar? Which one would I use in docker?
standalone is the uberjar
The other is just the project, no deps
how do I request a change in clojure. A clarification of a doc on a command (doc take-while) it doesn't explain that it will stop on first false.
https://github.com/clojure/clojure/blob/master/CONTRIBUTING.md#i-want-to-file-a-bug--suggest-an-enhancement > Please file it as a question on https://ask.clojure.org with the tag "problem" (possible bugs) or "request" (enhancements).
How is the docstring misleading though? It seems to me that the function does what it describes? > Returns a lazy sequence of successive items from coll while (pred item) returns logical true
:thinking_face: the opposite of logical true is logical false
correct but when someone new to programing reads it they assume it goes thru the entire coll, not stop, like filter would , early on this bit me. the reason I want to know, specifically it caused someone else trouble look at https://stackoverflow.com/questions/69845947/why-is-take-while-returning-empty-sequence/69868919#69868919 This causes issues for newbs. thanks pavlosmelissinos
What behaviour would you expect @UE0T2PKJA ? If it didn't terminate on first false how would it be different from filter?
I'm not expecting any other behavior but for new people the doc isnt clear (just for clarification I didnt post the question on stakoverflow)