Last active
August 12, 2020 05:46
-
-
Save kamisori/e4e26ad15000959244c6b985742cf258 to your computer and use it in GitHub Desktop.
I'm working on a webcomic framework for fun and I ran into the following "compile error: (macro) expected even number of arguments on line 25, column 8" When I comment the non-working version of this (lines 23 - 28) and use one of the working versions which are the same except they don't use the fn shorthand, everything is fine. Tried with: 06c2…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import hypertext) | |
(import ./src/data-access :as da) | |
(import ./src/data-presentation :as dp) | |
(import ./src/debug :as dbg) | |
(import sqlite3 :as sql) | |
#goes to dp when done: | |
(defn render-contents--works [page-contents] | |
(defn make-html [content] | |
(let [image-url (string "/blob/" (content :blobid))] | |
(hypertext/from-data | |
~(img {:src ,image-url})))) | |
(def sorted-contents (sorted-by |($ :position) page-contents)) | |
(map make-html sorted-contents)) | |
(defn render-contents--works-2 [page-contents] | |
(def sorted-contents (sorted-by |($ :position) page-contents)) | |
(map (fn [content] (let [image-url (string "/blob/" (content :blobid))] | |
(hypertext/from-data | |
~(img {:src ,image-url})))) | |
sorted-contents)) | |
(defn render-contents--doesnt [page-contents] | |
(def sorted-contents (sorted-by |($ :position) page-contents)) | |
(map |(let [image-url (string "/blob/" ($ :blobid))] | |
(hypertext/from-data | |
~(img {:src ,image-url}))) | |
sorted-contents)) |
andrewchambers
commented
Aug 12, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment