From 2ea5b9289c1798469a181b8725af65d4e909be1a Mon Sep 17 00:00:00 2001 From: "Duncan M. McGreggor" Date: Tue, 19 May 2015 23:08:24 -0500 Subject: [PATCH 1/2] Use standard indentation. --- README.rst | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.rst b/README.rst index bd5e1bf..a67bdcc 100644 --- a/README.rst +++ b/README.rst @@ -74,25 +74,25 @@ and execution will cease. (include-lib "deps/calrissian/include/monads.lfe") (defun dostuff () - (do-m (monad 'error) - (input <- (fetch-input)) ;; fetch-input -> (tuple 'ok result) | (tuple 'error reason) - (parsed <- (parse-input input)) ;; parse-input -> (tuple 'ok result) | (tuple 'error reason) - (store-data parsed))) ;; store-data -> 'ok | (tuple 'error reason) + (do-m (monad 'error) + (input <- (fetch-input)) ;; fetch-input -> (tuple 'ok result) | (tuple 'error reason) + (parsed <- (parse-input input)) ;; parse-input -> (tuple 'ok result) | (tuple 'error reason) + (store-data parsed))) ;; store-data -> 'ok | (tuple 'error reason) Without the error monad, the code might have looked like this: .. code:: scheme (defun dostuff () - (case (fetch-input) - ((tuple 'error reason) - (tuple 'error reason)) - ((tuple 'ok input) - (case (parse-input input) - ((tuple 'error reason) - (tuple 'error reason)) - ((tuple 'ok parsed) - (store-data parsed)))))) + (case (fetch-input) + ((tuple 'error reason) + (tuple 'error reason)) + ((tuple 'ok input) + (case (parse-input input) + ((tuple 'error reason) + (tuple 'error reason)) + ((tuple 'ok parsed) + (store-data parsed)))))) .. Links .. ----- From 47d70c87728cc8f6f1a49bb15a689bcfbab4c39e Mon Sep 17 00:00:00 2001 From: "Duncan M. McGreggor" Date: Tue, 19 May 2015 23:12:13 -0500 Subject: [PATCH 2/2] Using pwd in ERL_LIBS allows standard usage of include. Also, this allows one to use the same include when using the code in a release (a la relx, etc.). --- README.rst | 2 +- resources/make/common.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index a67bdcc..599f054 100644 --- a/README.rst +++ b/README.rst @@ -71,7 +71,7 @@ and execution will cease. .. code:: scheme - (include-lib "deps/calrissian/include/monads.lfe") + (include-lib "calrissian/include/monads.lfe") (defun dostuff () (do-m (monad 'error) diff --git a/resources/make/common.mk b/resources/make/common.mk index 2a2e4d9..e062f14 100644 --- a/resources/make/common.mk +++ b/resources/make/common.mk @@ -9,7 +9,7 @@ OUT_DIR = ./ebin TEST_DIR = ./test TEST_OUT_DIR = ./.eunit SCRIPT_PATH=$(DEPS)/lfe/bin:.:./bin:"$(PATH)":/usr/local/bin -ERL_LIBS=$(shell $(LFETOOL) info erllibs) +ERL_LIBS=$(shell pwd):$(shell $(LFETOOL) info erllibs) EMPTY = ifeq ($(shell which lfetool),$EMPTY) LFETOOL=$(BIN_DIR)/lfetool