Skip to content

Instantly share code, notes, and snippets.

@mudphone
Created October 28, 2015 13:34

Revisions

  1. mudphone created this gist Oct 28, 2015.
    19 changes: 19 additions & 0 deletions var.hy
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    ;;=> (var 0)
    ;;Traceback (most recent call last):
    ;; File "<input>", line 1, in <module>
    ;; File "<input>", line 4, in __init__
    ;;TypeError: object.__init__() takes no parameters

    (defclass var [PSet]
    []
    (defn --init-- [self c]
    (.--init-- (super) self [c]))

    ;; (defn --new-- [self c]
    ;; (.--new-- (super) self (pmap {c True})))

    (defn --str-- [self]
    (% "(var %s)" (first self)))

    (defn --repr-- [self]
    (str self)))