diff --git a/Makefile b/Makefile index d89507d95d..100e2f9086 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ DOCKERIZE = IMPLS = ada awk bash basic c d chuck clojure coffee common-lisp cpp crystal cs dart \ erlang elisp elixir es6 factor forth fsharp go groovy gst guile haskell \ - haxe io java julia js kotlin logo lua make mal ocaml matlab miniMAL \ + haxe hy io java julia js kotlin logo lua make mal ocaml matlab miniMAL \ nim objc objpascal perl perl6 php pil plpgsql plsql powershell ps \ python r racket rexx rpython ruby rust scala scheme skew swift swift3 tcl \ ts vb vhdl vimscript livescript elm @@ -199,6 +199,7 @@ gst_STEP_TO_PROG = gst/$($(1)).st java_STEP_TO_PROG = java/target/classes/mal/$($(1)).class haskell_STEP_TO_PROG = haskell/$($(1)) haxe_STEP_TO_PROG = $(haxe_STEP_TO_PROG_$(haxe_MODE)) +hy_STEP_TO_PROG = hy/$($(1)).hy io_STEP_TO_PROG = io/$($(1)).io julia_STEP_TO_PROG = julia/$($(1)).jl js_STEP_TO_PROG = js/$($(1)).js diff --git a/hy/run b/hy/run new file mode 100755 index 0000000000..97f856223b --- /dev/null +++ b/hy/run @@ -0,0 +1,2 @@ +#!/bin/bash +exec $(dirname $0)/${STEP:-stepA_mal}.hy "${@}" diff --git a/hy/step0_repl.hy b/hy/step0_repl.hy new file mode 100755 index 0000000000..9596f056f6 --- /dev/null +++ b/hy/step0_repl.hy @@ -0,0 +1,20 @@ +#!/usr/bin/env hy + +(defn READ [str] + str) + +(defn EVAL [ast env] + ast) + +(defn PRINT [exp] + exp) + +(defn REP [str] + (PRINT (EVAL (READ str) {}))) + +(while True + (try + (do (setv line (raw_input "user> ")) + (if (= "" line) (continue)) + (print (REP line))) + (except [EOFError] (break))))