Last active
August 29, 2015 14:16
-
-
Save taddeimania/736938e8f0ceee8a2f8d to your computer and use it in GitHub Desktop.
Accessing magic methods in Hy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defclass Person [] | |
[[name "joel"]]) | |
(setv me (Person)) | |
(print me.__class__) | |
(print "primitive".__class__) | |
;;from hy.core.language import name | |
;; class Person: | |
;; name = u'joel' | |
;; me = Person() | |
;; print(me.__class__) | |
;; print(u'primitive', .__class__) | |
;; REVISED!==================================== | |
(print (. "primitive" __class__)) | |
;; PRODUCES | |
;; print(u'primitive'.__class__) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment