- remove
-snapshot
from version number in bothpackage.json
andproject.clj
- probably run the tests one more time to make sure all is well
- add and commit changes with git
- create a git tag for to-be-released version
- push the commits and tag out to github
- run
npm publish .
(may need to re/register with npmjs.org) - deploy to clojars (maybe?)
- assuming all goes well, bump the version number and append
-snapshot
in bothpackage.json
andproject.clj
This file contains hidden or 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
(ns pettomato.findall | |
(:refer-clojure :exclude [==]) | |
(:use | |
[clojure.core.logic.protocols]) | |
(:require | |
[clojure.core.logic :refer :all])) | |
(defn findall | |
"A goal that unifies l with a lazy sequence containing all possible | |
instantiations of v that could be generated by applying the goal g |
This file contains hidden or 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
(ns hacklheber.core) | |
(defn flip | |
"A function which returns true or false randomly. Can optionally be | |
supplied a number for a bias." | |
([] (> 0.5 (rand))) | |
([p] (> p (rand)))) | |
(defn- memo-bangs | |
"If a variable is bound with a bang, then it will be memoized." |
This file contains hidden or 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
/* | |
* Nonogram/paint-by-numbers solver in SWI-Prolog. Uses CLP(FD), | |
* in particular the automaton/3 (finite-state/RE) constraint. | |
* Copyright (c) 2011 Lars Buitinck. | |
* Do with this code as you like, but don't remove the copyright notice. | |
*/ | |
:- use_module(library(clpfd)). | |
nono(RowSpec, ColSpec, Grid) :- |
Miles Sabin implemented a nice selection sort example in Scala's type system. See:
http://www.chuusai.com/2012/01/27/type-level-sorting-in-shapeless/
To get a better understanding how that works I ported the algorithm to Prolog.
selectleast([H|T], TM, [H|TRem]):-
selectleast(T, TM, TRem), TM < H.
selectleast([H|T], H, T).
This file contains hidden or 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
(ns lucenalog.core | |
"Lucenalog = Datalog interface to Lucene in 10 lines. | |
Simple but powerful. | |
Use | |
(db/add (index) {:a \"foo\" :b \"bar\"}) | |
to index a map with Lucene. Then you can use the relation |
This file contains hidden or 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
(defmacro assumedTrue | |
"will throw if any of the passed expressions evaluate to false or nil" | |
[& _] ;allows 0 or more params, but 0 params will throw and allow you to see the original line number | |
;(pri "` lexical env: `" ~a) | |
`(do | |
(let [myname# '~(first &form) ;aka the name of this macro | |
allPassedForms# '~(rest &form) ;all parameters passed to this macro | |
] | |
(cond (<= (count allPassedForms#) 0) | |
(throw |
This file contains hidden or 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
;; Symbolic differentiation | |
;; | |
;; translated from aprolog/examples/diff.apl | |
;; http://homepages.inf.ed.ac.uk/jcheney/programs/aprolog/examples/diff.apl | |
;; | |
(ns nominal.diff | |
(:refer-clojure :exclude [==]) | |
(:use [clojure.core.logic :exclude [is] :as l] | |
[clojure.core.logic.nominal :exclude [fresh hash] :as nom]) |
This file contains hidden or 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
(define-syntax prefix-sum | |
(syntax-rules () | |
((_ ((pvar ps) ...) body) | |
(prefix-sum* ((pvar ps) ...) 0 body)))) | |
(define-syntax prefix-sum* | |
(syntax-rules () | |
((_ () acc body) body) | |
((_ ((pvar ps) (pvar* ps*) ...) acc body) | |
(let ((pvar (+ ps acc))) |
This file contains hidden or 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
;;Support for simple constraints on lvars during unification was added in 76fd4d7c: | |
;; | |
;; https://github.com/clojure/core.logic/commit/76fd4d7c155161d74ad5cd8d87955148eece1fe0 | |
;; | |
;;but these constraints apply to a single lvar only. | |
;;The unifier could support more general constraints if it accepted an explicit predicate function. | |
;;For instance, given this `data-numeric?` predicate and `spec` data: | |
(defn data-numeric? [data dimension] |