Skip to content

Instantly share code, notes, and snippets.

@svetlyak40wt
Created October 26, 2015 11:09
Show Gist options
  • Save svetlyak40wt/5bdb51b14db4a2eb389f to your computer and use it in GitHub Desktop.
Save svetlyak40wt/5bdb51b14db4a2eb389f to your computer and use it in GitHub Desktop.
Apply function in hy does not work anymore
(defn blah [foo &optional bar]
(print foo)
(print bar))
(try
;; this does not work in Hy-0.11
(apply blah [1] {"bar" 2})
(except [e Exception]
(print '(apply blah [1] {"bar" 2}) "does not work, throwing:" e)))
(try
;; this does not work in Hy-0.11
(apply blah [] {"foo" 1 "bar" 2})
(except [e Exception]
(print '(apply blah [] {"foo" 1 "bar" 2}) "does not work, throwing:" e)))
(try
;; this - does in Hy-0.11 but don't in Hy-0.10
(blah 1 :bar 2)
(except [e Exception]
(print '(blah 1 :bar 2) "does not work, throwing:" e)))
[+|art@art-osx4:~/projects/sprinter]% hy -v
hy 0.10.1
[+|art@art-osx4:~/projects/sprinter]% hy check.hy
1
2
1
2
(u'blah' 1L u'\ufdd0:bar' 2L) does not work, throwing: blah() takes at most 2 arguments (3 given)
[+|art@art-osx4:~/projects/sprinter]%
[+|art@art-osx4:~/projects/sprinter]%
[+|art@art-osx4:~/projects/sprinter]% env/bin/hy -v
hy 0.11.0
[+|art@art-osx4:~/projects/sprinter]% env/bin/hy check.hy
('apply' 'blah' [1] {'bar' 2}) does not work, throwing: blah() missing 1 required positional argument: 'foo'
('apply' 'blah' [] {'foo' 1 'bar' 2}) does not work, throwing: blah() missing 1 required positional argument: 'foo'
1
2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment