First, let's get a summary of what's going on:
$ cat ca | cut -f 2 -d " "| sort | uniq -c
15066 </bill/id>
15066 </bill/session>
51722 </bill/sponsor>
35194
| using System; | |
| using System.Diagnostics; | |
| // Some helpers for converting GPS readings from the WGS84 geodetic system to a local North-East-Up cartesian axis. | |
| // The implementation here is according to the paper: | |
| // "Conversion of Geodetic coordinates to the Local Tangent Plane" Version 2.01. | |
| // "The basic reference for this paper is J.Farrell & M.Barth 'The Global Positioning System & Inertial Navigation'" | |
| // Also helpful is Wikipedia: http://en.wikipedia.org/wiki/Geodetic_datum | |
| // Taken from https://gist.github.com/govert/1b373696c9a27ff4c72a |
| " Place me into after/plugin/fireplace.vim in your Vim directory. Don't overwrite anything! | |
| augroup fireplace_connect | |
| autocmd FileType hy command! -buffer -bar -nargs=* | |
| \ Connect FireplaceConnect <args> | |
| augroup END | |
| function! s:set_up_eval() abort | |
| command! -buffer -bang -range=0 -nargs=? Eval :exe s:Eval(<bang>0, <line1>, <line2>, <count>, <q-args>) |
First, let's get a summary of what's going on:
$ cat ca | cut -f 2 -d " "| sort | uniq -c
15066 </bill/id>
15066 </bill/session>
51722 </bill/sponsor>
35194
| (require hy.contrib.loop) | |
| (import [random [shuffle]]) | |
| (def ranks (+ (range 2 11) [:a :k :q :j])) | |
| (def suits [:h :c :d :s]) | |
| ;; OH MY IMPERATIVE GAAWD! | |
| (def deck []) | |
| (for [rank ranks | |
| suit suits] |
| ;; hy-lang fizzbuzz | |
| (import [itertools [count imap]]) | |
| (import [pprint [pprint]]) | |
| (defn freq [v n] | |
| (->> (* [""] (dec n)) (+ [v]))) | |
| (defn fizzbuzz [] | |
| (->> (imap (fn [f b n] (or (+ f b) n)) |
| function! g:Refresh_hy_python_preview() | |
| redir => message | |
| redir END | |
| let pyfile = substitute(bufname("%"), ".hy", "", "") . ".generated.py" | |
| let errfile = substitute(bufname("%"), ".hy", "", "") . ".error" | |
| exec "silent !~/hy/bin/hy2py % > " . pyfile . " 2> " . errfile . " || cat " . errfile . " > " . pyfile | |
| call MyPreviewVSplit(pyfile) | |
| set nomodified | |
| "exec "silent !rm " . pyfile . " " . errfile | |
| redraw! |
| ⏚ [nicolasd:~/code/parsley] [parsley] $ python test_parsley.py | |
| ('root', | |
| [(1, 0), (346, 0)], | |
| ('parens', | |
| [(3, 0), (3, 36)], | |
| ('token', [(3, 1), (3, 12)], 'import-from'), | |
| ('token', | |
| [(3, 13), (3, 28)], | |
| 'tests.resources'), | |
| ('token', [(3, 29), (3, 35)], 'kwtest')), |
PyPy is ruddy fast. So is Hy.
Time of fib(9), using a simple recursive implementation.
| ; vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 filetype=lisp | |
| ; Copyright (c) Paul Tagliamonte, in sofar as any of this is at all | |
| ; copyrightable. | |
| (puts "Hello, World!") | |
| ; "Hello, World!" | |
| (import ["os" | |
| "sys"]) |
| ; vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 filetype=lisp | |
| ; Copyright (c) Paul Tagliamonte, in sofar as any of this is at all | |
| ; copyrightable. | |
| (def hello "World!") | |
| (def square (fn [arg] | |
| (* arg arg))) |