<reponame>markomanninen/calchylus<filename>calchylus/__init__.py<gh_stars>1-10
#! /usr/bin/python3
# -*- coding: utf-8 -*-

import hy
#import calchylus
from hy.importer import hy_eval, import_buffer_to_hst

def heval(tokens):
    try:
        return hy_eval(import_buffer_to_hst(tokens), {}, '<string>')
    except Exception as e:
    	print(e)

def peval(tokens):
	return heval("(print %s)" % tokens)

def Y(tokens):
	return heval("""
(require [calchylus.lambdas [*]])
(import [calchylus.lambdas [*]])
(with-alpha-conversion-and-macros L ,)
%s
""" % tokens)

#! /usr/bin/python3
# -*- coding: utf-8 -*-

import hy
#import calchylus
from hy.importer import hy_eval, import_buffer_to_hst

def heval(tokens):
    try:
        return hy_eval(import_buffer_to_hst(tokens), {}, '<string>')
    except Exception as e:
    	print(e)

def peval(tokens):
	return heval("(print %s)" % tokens)

def Y(tokens):
	return heval("""
(require [calchylus.lambdas [*]])
(import [calchylus.lambdas [*]])
(with-alpha-conversion-and-macros L ,)
%s
""" % tokens)
#! /usr/bin/python3 # -*- coding: utf-8 -*- #import calchylus (require [calchylus.lambdas [*]]) (import [calchylus.lambdas [*]]) (with-alpha-conversion-and-macros L ,) %s