Created
          October 26, 2015 11:09 
        
      - 
      
- 
        Save svetlyak40wt/5bdb51b14db4a2eb389f to your computer and use it in GitHub Desktop. 
    Apply function in hy does not work anymore
  
        
  
    
      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
    
  
  
    
  | (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))) | 
  
    
      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
    
  
  
    
  | [+|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