Chris G
09/21/2020, 5:09 PMDrewverlee
09/22/2020, 1:04 PM[:what
[::global ::all-todos all-todos]
[::global ::showing showing]
:then
(let [*session (orum/prop)
active-todos (remove :done all-todos)
completed-todos (filter :done all-todos)
active (count active-todos)
completed (count completed-todos)
filter-attrs (fn [filter-kw]
{:class (when (= filter-kw showing) "selected")
:on-click #(insert! *session ::global {::showing filter-kw})})]
[:footer#footer
[:span#todo-count
[:strong active] " " (case active 1 "item" "items") " left"]
[:ul#filters
[:li [:a (filter-attrs :all) "All"]]
[:li [:a (filter-attrs :active) "Active"]]
[:li [:a (filter-attrs :completed) "Completed"]]]
(when (pos? completed)
[:button#clear-completed {:on-click #(run! (partial retract! *session)
(map :id completed-todos))}
"Clear completed"])])]
shalabh
09/23/2020, 6:01 PMNick Smith
09/24/2020, 8:27 AMJack Rusher
09/24/2020, 1:52 PMEmmanuel Oga
02/02/2021, 4:31 AMEmmanuel Oga
02/24/2021, 5:37 AMEmmanuel Oga
04/29/2021, 9:56 PMMaier and Warren's Computing with Logic (1988) is the best reference for those interested in implementing Prolog. It starts with a simple interpreter for a variable-free version of Prolog, and then moves up to the full language, adding improvements to the interpreter along the way.
... seems to be a cool book but a bit archaic with example code in Pascal... but I guess Pascal is a simple enough language to port to something else without too much effort... hopefully 😛 The bad thing is that I couldn't find the source code anywhere so I'm afraid it may be missing bits and pieces in the book.Rob Haisfield
05/19/2021, 1:21 PMEmmanuel Oga
05/28/2021, 9:31 PMRob Haisfield
06/03/2021, 10:30 PMEmmanuel Oga
06/16/2021, 4:13 AMEmmanuel Oga
06/16/2021, 8:06 AMEmmanuel Oga
06/22/2021, 6:40 AMDatalog disallows complex terms as arguments of predicates, e.g., p (1, 2) is admissible but not p (f (1), 2)Perhaps unification of complex/custom data structures is more productive for pattern matching than for general logic programming ... but not sure (SWI prolog's dict maybe contradicts this idea).
Emmanuel Oga
07/15/2021, 12:42 AMGordon
07/29/2021, 7:47 AMEmmanuel Oga
11/17/2021, 8:50 AMJason Morris
01/19/2022, 9:41 PMDrewverlee
03/12/2022, 7:53 PMJason Morris
07/15/2022, 5:01 AMcurious_reader
08/19/2022, 11:17 AMcurious_reader
08/19/2022, 11:18 AMcurious_reader
08/19/2022, 11:23 AMwtaysom
09/08/2022, 2:30 AMJason Morris
10/04/2022, 10:30 PMJason Morris
02/01/2023, 7:23 PMJason Morris
04/01/2023, 10:09 PMguitarvydas
04/11/2023, 9:22 AMdrop_amount
.
Then, I will need to figure out what z
and none
are ...
Aside: I’m using Nils Holm’s “Prolog ... in 6 Slides” (Scheme code ported to CL (and JS)).Jason Morris
08/15/2023, 4:01 PM