Skip to content

Commit

Permalink
Hy: step0
Browse files Browse the repository at this point in the history
  • Loading branch information
kanaka committed Sep 20, 2017
1 parent cf01dac commit 67365c0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions hy/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
exec $(dirname $0)/${STEP:-stepA_mal}.hy "${@}"
20 changes: 20 additions & 0 deletions hy/step0_repl.hy
Original file line number Diff line number Diff line change
@@ -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))))

0 comments on commit 67365c0

Please sign in to comment.