I am trying to write a program in Hy and run it per the instructions on the Quickstart page in the documentation.
So I installed Hy using pip from the GitHub repo per the docs, then added executable permissions to the file with chmod +x myfile.hy.…
I'd like to use Hy, a dialect of Lisp on top of Python. However my coworkers all use Python and aren't likely to switch over to a Lisp dialect any time soon.
How can I package Hy code into a standard Python module?
I have successfully installed hy-mode from https://github.com/hylang/hy-mode. I now can open a .hy file in emacs and have syntax highlighting, and editing with paredit is a joy.
I however, don't know how to start a REPL. At the bottom of the github…
I want to do the following in hy:
from StringIO import StringIO
import pandas as pd
s = """sepal_length sepal_width petal_length petal_width species
0 5.1 3.5 1.4 0.2 setosa
1 4.9 3.0 …
I am trying to generate some python code from Hy. How is that done better?
I have tried several approaches. One is with a macro:
(defmacro make-vars [data]
(setv res '())
(for [element data]
(setv varname (HySymbol (+ "var" (str element))))
…
I am writing macros to simplify making plots with matplotlib. My first attempt, as follows, works correctly:
(defmacro insert-ax [body] `((getattr g!ax (str '~(first body))) ~@(rest body)))
(defmacro/g! plot [main &optional title [fig-kwargs {}]]
…
how to print a object HyExpression as
HyExpression([
HyExpression([
HySymbol('/'),
HyInteger(2)]),
HyExpression([
HyString('ceil')])])
as
'((/ 2) ("ceil"))'
in console ?
Has import changed in Hy version 1.0a4+199.g22021c56?
I'm trying to import a file from the same folder (or cwd), but I get ModuleNotFoundError: No module named 'thenameofthefile'
Even if I append current path to sys.path.
This is how you can…
Comming from Common Lisp, I'm trying to use let to shadow the value of a global variable dynamically.
(setv glob 18)
(defn callee []
(print glob))
(defn nonl [x]
(callee)
(let [glob x]
(callee))
(callee))
(nonl 39)
=>
18
18
18
Is…
We are trying to use hylang as DSL for some financial business flow. We were trying to use business rules as JSON, but switched to DSL using hy language. Now we need to persist s-expression items into postgreSQL as like previous JSON-B items. Is…
Perhaps I am misunderstanding something.
In Hy, if* can take (after the if* symbol)
one predicate (evaluation returned if there are no further expressions)
zero or one consequent (evaluated and returned if the predicate is truthy)
(if a consequent…
I was playing around with symbols and was surprised to see that:
hy 0.18.0 using CPython(default) 3.7.3 on Linux
=> (bool '0)
False
=> (bool 'False)
True
=>
Is that a design decision? What is the best way to represent boolean values on Hy?