This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-23
Channels
- # 100-days-of-code (5)
- # announcements (3)
- # beginners (68)
- # cider (2)
- # cljdoc (2)
- # cljs-dev (10)
- # cljsjs (2)
- # clojure (40)
- # clojure-austin (2)
- # clojure-dev (17)
- # clojure-italy (8)
- # clojure-spec (4)
- # clojure-uk (9)
- # clojurebridge (1)
- # clojurescript (48)
- # datomic (4)
- # emacs (4)
- # figwheel-main (93)
- # fulcro (8)
- # hyperfiddle (33)
- # jobs-discuss (3)
- # luminus (60)
- # off-topic (66)
- # onyx (42)
- # pedestal (11)
- # re-frame (35)
- # reagent (1)
- # reitit (39)
- # shadow-cljs (30)
- # specter (27)
@hoopes As a bit of a follow up to the discussion earlier about JVM-based web servers: it's common for them to handle each new request in a separate thread automatically. They typically have a pool of threads and if no threads are available, incoming requests will stall until a thread is available (so it is important to tune threads if you're dealing with really high traffic). When folks talk about async in the Clojure world tho', they generally mean something a bit different (since the basic web servers are already multi-threaded and handle concurrent requests out-of-the-box). Pretty much all Clojure web apps are built with Ring, which is a nice abstraction over HTTP requests and responses. Ring -- and other similar libraries -- have the concept of both synchronous and asynchronous requests -- and the latter is what most folks will think of when you talk about "async" in the context of web servers. With a synchronous request, the request comes in, is processed, and a response is sent back to the client -- and the handler functions for such requests take just one argument: the Ring request hash map. With an asynchronous request, the handler functions have three arguments: the Ring request hash map, a response function to be called with a successful result and a raise function to be called with a failure (as in "raising an exception"). /cc @azzurite
Library pandoc
has some namespaces like pandoc.core
, pandoc.pre
pandoc.post.compress
pandoc.post.env
pandoc.post.json
pandoc.render
etc. I want to apropos search all pandoc related namespaces. like (apropos "pandoc.*")
. How to do this?
Not supported...
What is the meaning of the convention of ending function’s names with a *
?
@vincent.cantin Usually they pop up when you need a wrapper around the actual main function.
For example, you have a function that does something, call it something*
. Then you want to memoize it, so you (def something (memoize something*))
.
I see, thank you.
@vincent.cantin No, the *
is not literal, the meaning is like in regexp or wildchar etc.
yeah, that was not related, sorry.
Aha, misunderstand. 😂
what are your opinions what are the easyiest fastest and most fun ways to learn the language, to have a solid and gounded knowledge?
<Http://codingame.com> and the book "Clojure for the Brave and True", or "programming clojure" if you already know enough about programming in general
1. How do you learn best? 2. What is your current programming background? 3. what is your end-game goal?
There are many alternatives
@borblytams Doing the problems at http://www.4clojure.com meets a lot of those criteria
I’ve used advent of code (see resulting blog post here: https://orestis.gr/25-days-of-clojure/ ) to get some fun problems.
using depstar, i can create a jar file easily. But I'm not sure I understand how to set the main entry point? I'm very new to the java side of clojure. Does anyone know offhand how to do this? I used clj -A:new app test/newapp
to use sean's extremely nice template system. Then clj -A:depstar -m hf.depstar.uberjar test.jar
. The only ns in this project has (:gen-class)
on it so it should have a java class there I'm just not sure of that final part of how to mark this as the entry point
The default main is defined by the manifest, which is just a file at META-INF/MANIFEST.MF
It looks like depstar excludes any local META-INF
folder from the JAR. I created src/META-INF/MANIFEST.MF
containing Main-Class: clojure.main
and the uberjar that depstar built didn't contain it. Is that right @ghadi? Depstar excludes any META-INF
it finds on the classpath? /cc @dpsutton
OK, you can add one manually:
jar ufm myuber.jar mymanifest
where mymanifest
contains just Main-Class: clojure.main
or whatever main namespace you'd prefer. I'll add that to issue #5 (and suggest the README be updated to include that information!).PR sent.
perhaps you could just build and include it manually?
I think you just need a Main-Class: path.to.class
kind of a weird problem: I’m trying to get the line number and position of a key and value in a data structure when it’s pretty printed
I think there are only clever ways to do this :)
I started off with a naive approach to get the line number by replacing the value at the path with a special keyword, but that can affect the line width which in turn can cause the line to break/not break when pprinting
it seems like the best time to discover this is when you’re printing. I can’t think of any kind of printer that currently tracks that though
a lot of that stuff was ported from common lisp and is hard to track
there are other printers like fipp and zprint
@dpsutton I thought with Depstar you could just specify the main namespace at runtime but I also get that "Error: Invalid or corrupt jarfile test.jar" -- just following the README doesn't seem to work. @ghadi What are we both missing here?
@dpsutton Looks like we're not the only ones to run into this https://github.com/healthfinch/depstar/issues/5
yeah i saw that but unfortunately there was no action and no even explanation of circumstances of how they ran into the issue 😞
@seancorfield depstar doesn't do any AOT, nor let you specify a main class
@ghadi so how do you use the uberjar? When you say "uberjar" people have expectations 😄
I don't want or need AOT by the way. The clojure.main class is in there and that's what I'd use.
What is the best method to stylise websites made with re-frame? is it with css or how does it work?
Or any other advice to make websites more beautiful with re-frame/clojurescript for a beginner like me is highly appreciated
jmp it's very easy to toss bootstrap and font awesome to get a structure going. these have some reusable components that can help you quickly create a styled webapp. if you're going to do webapps for a while and design is a focus it would be worth your time to pursue css and design more deeply but these are great starting points
https://github.com/noprompt/garden is really nice as well
But does it make sense to do it within clojure using something like the one you linked or is it most common to keep the css part and the cljs part separate as much as possible? I’m just wondering how to structure my project when it comes to visuals/logic
it really depends on how complex your app is and what you (or your team) is comfortable with
IMO I think CSS-in-JS is really excellent, but I also work on a huuuuge application with lots of devs. so being able to easily isolate and import/export styles is a big deal for my project
for general web dev, plain CSS is just fine and garden can help write that without having to context switch from Clojure
FWIW, at work we use plain CSS in separate files, and HTML templates with Selmer rather than Hiccup, so that our front end folks and, in particular, our UI/UX designer, can work with our web app's visuals.
We used Hiccup for a couple of things and we couldn't get any support from the front end folks since they work with CSS, JS, and HTML.
So, yes, I'd agree with @dpsutton here and recommend keeping your CSS external and learning it standalone rather than trying to learn CSS via something like Garden.
lein does some release stuff, but you can't increment version in dev-> merge into master -> tag master -> go back and increment version on dev branch, right?
rich hickey opposes pattern matching, what is the alternative? how does one parse input and capture it in a parameter? what am i missing?
what is that snippet supposed to do?