Skip to content

Commit b8ee29b

Browse files
committedJan 9, 2015
All: add keywords.
Also, fix nth and count to match cloure.
1 parent aaba249 commit b8ee29b

File tree

194 files changed

+1749
-1101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+1749
-1101
lines changed
 

‎Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ java_RUNSTEP = mvn -quiet exec:java -Dexec.mainClass="mal.$($(1))" -Dexec.arg
7878
js_RUNSTEP = node ../$(2) $(3)
7979
make_RUNSTEP = make -f ../$(2) $(3)
8080
mal_RUNSTEP = $(call $(MAL_IMPL)_RUNSTEP,$(1),$(call $(MAL_IMPL)_STEP_TO_PROG,stepA),../$(2),") #"
81-
perl_RUNSTEP = perl ../$(2) $(3)
81+
perl_RUNSTEP = perl ../$(2) --raw $(3)
8282
php_RUNSTEP = php ../$(2) $(3)
8383
ps_RUNSTEP = $(4)gs -q -I./ -dNODISPLAY -- ../$(2) $(3)$(4)
8484
python_RUNSTEP = $(PYTHON) ../$(2) $(3)

‎bash/core.sh

+12
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ false? () { _false? "${1}" && r="${__true}" || r="${__false}"; }
4141
symbol? () { _symbol? "${1}" && r="${__true}" || r="${__false}"; }
4242

4343

44+
# Keyword functions
45+
46+
keyword? () { _keyword? "${1}" && r="${__true}" || r="${__false}"; }
47+
48+
4449
# Number functions
4550

4651
number? () { _number? "${1}" && r="${__true}" || r="${__false}"; }
@@ -230,6 +235,10 @@ concat () {
230235

231236
nth () {
232237
_nth "${1}" "${ANON["${2}"]}"
238+
if [ -z "${r}" ]; then
239+
_error "nth: index out of bounds"
240+
return
241+
fi
233242
}
234243

235244
empty? () { _empty? "${1}" && r="${__true}" || r="${__false}"; }
@@ -316,7 +325,10 @@ declare -A core_ns=(
316325
[nil?]=nil?
317326
[true?]=true?
318327
[false?]=false?
328+
[symbol]=_symbol
319329
[symbol?]=symbol?
330+
[keyword]=_keyword
331+
[keyword?]=keyword?
320332

321333
[pr-str]=pr_str
322334
[str]=str

0 commit comments

Comments
 (0)
Please sign in to comment.