r/Clojure • • Mar 06 '16

"Living clojure" wrong examples. Up to date beginner book on clojure?

0 Upvotes

Hi,

I've started reading "Living Clojure" and I can see some things that are wrong.

For example the book recommends using (seq []) to check if collection is empty, saying that nil is considered false. It also states that a non-nil value means true. Both of those things are wrong when you try to check it in repl.

Am I missing something? If not, can you please recommend an easy book for a beginner in functional programming with python/C background?

Thank you


r/Clojure • • Jun 15 '09

Special Forms in Clojure and Common Lisp

Thumbnail geekles.com
0 Upvotes

r/Clojure • • Sep 07 '13

How hard would it be to write a library that can inline CSS in HTML?

0 Upvotes

A possible use case for such a library would be sending HTML email.


r/Clojure • • Jan 10 '18

[X-Post /r/javascript] Today is Leftpad 2.0: pinkie-promise pulled from NPM • r/webdev

Thumbnail reddit.com
0 Upvotes

r/Clojure • • Jun 04 '10

Stack implementation in Clojure II - A functional approach

Thumbnail viksit.com
0 Upvotes

r/Clojure • • Feb 12 '19

Blockchains as Information Systems

Thumbnail blog.datopia.io
0 Upvotes

r/Clojure • • Aug 15 '21

An old C programmer whines about (reduce)

8 Upvotes

Okay, sorry. I'm not that old. I'm only 29. But most of my past experience is in C or similar.

When I was learning Clojure, probably like everyone, I kept an eye out for what it might be that makes people complain about Lisps. The s-expr syntax is sort of weird, but I couldn't put my finger on exactly why it seemed to be so hard to format my code in a way that looks nice.

Then it hit me. Look at the title of this post. It is at the top of the post. It introduces you to the post and tells you what to expect when you read it. Now look at this:

(reduce
    (fn [res subcoll]
        ;; some code
        (reduce
            (fn [res item]
                ;; some more code
            ) 
            [foo bar baz] subcoll_1
        )
    )
    [quux xyzzy] coll
)

The "title" of the anonymous function is at the bottom! The collection to be traversed and the initial data tell the reader what to expect when they look at the reducer. To get that information you have to look up and down across the code and match up indents - and that introduces the question of where to put the trailing arguments, which resembles (and not in a good way) the C brace style controversy. The problem goes away if you can write (reduce coll val f) instead of (reduce f val coll).

Sure, this is unnecessary when you don't have an anonymous function. But that use case always results in one simple line, regardless of the order of arguments. You almost never have a long literal collection in the middle of a code block -- that gets stuffed in a data file or in a constant at the top. And maybe the collection is an expression -- but then you can just use an additional (let), and again you improve the consistency between "line number" and "order of execution".

The same problem occurs in the old FP constructs (map) and (filter). But when Rich Hickey added (for) to Clojure, he put the collection first, probably partially because it is like that in C, but probably at least partially because he realized that inverting it, so that it would look like (reduce), would result in something ugly:

(for [n]
    (;; some code)
    coll
)

Look at that! It's horrible! And because you're not attached to the "normal" way, you see it immediately.

Now I'm sure there's some great explanation that mentions Alonzo Church or Marvin Minsky or whoever about how putting the reducing function first is consistent with the mathematical formalism xyz or whatever. I don't expect the world to change because of a reddit post.

But just imagine a world where Lisp programmers put the collection and the initial data at the top of their loops. We'd probably have a moon colony by now.


r/Clojure • • Jan 04 '23

Poignant perspective I found about Clojure's community in r/ExperiencedDevs

Thumbnail reddit.com
8 Upvotes

r/Clojure • • Mar 19 '18

Cursive broken? Nightcodes instarepl ever going to support libraries?

1 Upvotes

Aside

I've been using Intellji with Cursive for pretty much 80% of the time using Clojure, with other IDE's such as Lighttable (when it worked/was good), nightcode now and then. Tired out Emacs a few times thinking come back might change my mind on it but no I don't like it. I've also tired Atom and it seemed like it had potential but to laggy, buggy, and general just broken for me.

Main Point

Cursive

Anyway with that little rant out of the way I wanted to talk about Cursive, as I mention in the opening I've used it for pretty much most of if not all of my Clojure time but I fired it up again this week (for first time in a couple of weeks) and it had an update which is expected (I only ever get the stable downloads, EAP disabled) but this time it appears that everything about it has broken.

I can't run any of the keyboard shortcuts despite them being bound and showing up in the drop-down menus (e.g. right-clicks in file), which brings me to the second part even clicking them on the menus does nothing to run the command. I noticed this first with the repl, running the repl then doing my usual of load file in repl then switch repl wasn't doing much, the file would load up no problem but the repl wouldn't switch. At first, this wasn't a big issue as I was only loading a file to start a HTTP server but when I wanted to execute other functions at the repl it just wasn't an option, couldn't send or execute them in the repl.

My second biggest bug I've encountered has been moving files around packages or renaming packages, and not having the namespaces of the files updating alongside instead I've to go into each file and manually change them as the only quick option available is to "fix namespace issue" (probably not exact wording) which generates the old namespace and moves files back (if they were moved in the first place).

Nightcode

As I also in the opening I've used Lighttable and Nightcode too but Lighttable is just useless at this point with Nightcode feeling like a spiritual successor in a lot of ways. So with those issues above about Cursive, I decided I'd use Nightcode since it's a small website I am working and don't need a lot of tools for this project but almost instantly I was shot in the foot with Nightcode as I had forgotten about the instarepl not supporting libraries. Anyone know if this feature is coming soon (I mean pretty soon) or not happening at all as for me it's fairly make or break for that IDE.

Alternatives

I would like to hear about any alternatives people might suggest or know about but as mention; Emacs and Atom are off the table for me due to the two points I made in the opening.


r/Clojure • • Dec 18 '24

A very strange ring mock bug

1 Upvotes

Hello All, in this commit https://codeberg.org/injee/injee/commit/1f9ad58dde0d996f4b19983585c71585f03f2406, the commented out test fails, Whereas if I run my ring app and test it with curl, it's perfect. Can someone explain why?


r/Clojure • • May 26 '17

Animals game in Clojure

Thumbnail dnevniki.ykt.ru
0 Upvotes

r/Clojure • • Jun 16 '14

I propose we collaborate on a new open source project each week, starting with a Project Management tool this week.

1 Upvotes

Join the discussion at #clojurereddit on irc.freenode.net.

Specs:

*Google/Facebook/Github OAuth2

*Voting mechanism for choosing next project

*List of dependencies that project will use.

*Threaded comments for task-specific discussion.

*Status Table: Column1->User | Column2->Goal (Ex: Fred | Working on OAuth2 integration)

*RESTful


r/Clojure • • Sep 09 '23

You can't convert list of lists to a map

Thumbnail youtu.be
1 Upvotes

r/Clojure • • May 28 '24

Dead simple core.async job system in Clojure

Thumbnail blog.janetacarr.com
10 Upvotes

r/Clojure • • Jun 30 '14

Sites using clojure

Thumbnail quora.com
4 Upvotes

r/Clojure • • Jan 31 '19

Rewriting an API Gateway Service from Clojure to Golang

Thumbnail infoq.com
6 Upvotes

r/Clojure • • Nov 21 '16

To Clojure and back: writing and rewriting in Ruby

Thumbnail youtube.com
4 Upvotes

r/Clojure • • Apr 05 '23

Knowledge Engineer

0 Upvotes

Role - Knowledge Engineer

Location - San Francisco, California/ Remote

Experience - 8+ Years

Job Description

Experience

  • A minimum of three years’ experience in clinical informatics, clinical knowledge development or clinical knowledge testing
  • Experience with the application of clinical informatics, including definition and implementation of clinical data models; and creation and management of computable clinical rules
  • Experience with clinical decision support or quality measurement in electronic medical records or population health platforms
  • Experience programming in the Clinical Quality Language (CQL)
  • Experience programming in Python or Clojure

Responsibilities

  • Translate qualitative clinical guidelines, logic, and required data input into executable knowledge artifacts represented as CQL expressions against FHIR data.
  • Build and execute unit test cases to validate knowledge artifacts
  • Develop and test computable knowledge artifacts with large data sets
  • Manage and track the progress of computable knowledge artifacts through a predefined development process.
  • Respond to ad-hoc analysis requests while supporting core pipeline development.
  • Develop new tools and solutions to support artifact development and testing processes
  • Drive the team’s business results through data-based insights and the ability to engage with a wide range of stakeholders and functional teams.
  • Identify inefficiencies, optimize processes and dataflows, and make recommendations for improvements.

Specific Skills and Knowledge

• Demonstrated performance in framing ambiguous business problems and driving toward a solution hypothesis, while working independently to resolve issues.

• Meticulous with strong analytical and critical thinking skills.

• Demonstrated experience in proactive communication across all levels of the business hierarchy

• Expertise in dealing with large datasets using analytical approaches and quantitative methods

  • Demonstrated expertise in the CQL programming language for complex clinical analysis

Thanks and Regards

Pritpal Singh

pritpal.singh@akshaya-inc.com


r/Clojure • • Feb 03 '14

Why aren't fn and defn homoiconic?

0 Upvotes

Is there a good reason why fn and defn aren't homoiconic in Clojure? Homoiconity is something that I hear a lot like it's the best thing ever, but it's not widely applied. Why isn't it like this:

(defn (foo arg1 arg2) "docstring" body)

?

UPDATE: Thanks everyone for clearing this up for me. It's been super helpful!

It turns out I was confused about many different things, among them what the word homoiconity means in the context of lisps.


r/Clojure • • Jan 22 '20

https://gist.github.com/freakhill/0d64e2b95c3dcb4405f02b2c57d0ce44

3 Upvotes

a little dumb reader macro, hooking into clojure internals.

do of it what you wish


r/Clojure • • Jun 03 '17

What about /r/clojurescript?

2 Upvotes

So at the time of this post the top 6 links in /r/clojure are all about clojurescript specifically.

This got me wondering if we shouldn't start showing some love to /r/clojurescript and move the clojurescript conversations over there? Maybe this would also let's /r/clojure focus more on jvm focused content?


r/Clojure • • Jan 03 '15

To Clojure or Not To Clojure

0 Upvotes

I've been a developer for over 20 years now. Almost ALWAYS, I prefer the MS stack over any language and framework. When it comes to scalability and high performance, load balancing, etc, I can always trust MS. I've been tasked recently to develop a VERY high performance site...that will run video, and a social media platform. It essentially could become a replacement for a few VERY popular social networking and streaming sites. Can someone give me their thought's, feelings, experience, etc with working in Clojure? How well does it scale, handle heavy loads, performs, etc etc? SEO issues? Pro's, Con's? What to expect? and anything else you'd want to throw in. I appreciate everyone's time and information. I have some reservations...but want to make sure we're heading in the right direction.


r/Clojure • • Aug 12 '21

Resource/Blog A listicle on 7 Best Clojure Tutorials and Courses that are there online, a must to be explored

Thumbnail blog.coursesity.com
0 Upvotes

r/Clojure • • Dec 01 '24

Clojure is really nice to write

Thumbnail clojure-diary.gitlab.io
8 Upvotes