I hereby claim:
- I am spacebat on github.
- I am spacebat (https://keybase.io/spacebat) on keybase.
- I have a public key whose fingerprint is 0929 8712 0340 D898 4381 69DD 3067 D9AD 2796 55F6
To claim this, I am signing this object:
| ;;; Just mucking about with funcallable instances. This class defines | |
| ;;; an instance that "freezes" a specified set of special variable | |
| ;;; bindings at the time of instantiation, so when the instance is | |
| ;;; called these bindings are preserved. This could be achieved with a | |
| ;;; closure, but then you couldn't read and alter the bindings so | |
| ;;; easily. | |
| (ql:quickload :closer-mop) | |
| (defclass icicle () |
| ;; An example of append method combination to form a projection of an object's slots | |
| (defclass odour-mixin () | |
| ((odour :initarg :odour :initform nil :reader odour))) | |
| (defclass colour-mixin () | |
| ((colour :initarg :colour :initform nil :reader colour))) | |
| (defclass sound-mixin () | |
| ((sound :initarg :sound :initform nil :reader sound))) |
| (defun char-successor(c) | |
| "values are succesor and carry, same case for letters" | |
| (cond | |
| ((char= c #\9) (values #\0 t)) | |
| ((char= c #\Z) (values #\A t)) | |
| ((char= c #\z) (values #\a t)) | |
| ((alphanumericp c) (values (code-char (1+ (char-code c))) nil)) | |
| (t (values c t)))) | |
| (defun string-successor(s) |
| (defconst my/lookup-extra-handlers nil) | |
| (cl-defun my/lookup (map key &key default test type) | |
| (typecase map | |
| (list | |
| (case type | |
| (plist (getf map key default)) | |
| (list (nth key map)) | |
| (t (let ((cell (assoc key map))) | |
| (if cell |
| ;; See http://malisper.me/2015/11/10/defmemo/ | |
| (defmacro defmemo (name-and-cache args &body body) | |
| "Define a memoized function. NAME-AND-CACHE may be a symbol naming | |
| the function, or a property list in which case the name is specified | |
| in the property :name. When a list is supplied, a set of functions | |
| named by the properties :cache, :reader and :writer may be | |
| supplied. The cache function must return an object that supports a | |
| protocol like hash-table with equality test sufficient to discriminate | |
| the arguments to the memoized function. The reader accepts |
| #!/usr/bin/env perl | |
| # Adapted from tutorial Copyright (c) 2013 Peter Stuifzand | |
| # at http://marpa-guide.github.io/chapter3.html | |
| # In particular this is an attempt at Exercise 3 | |
| use strict; | |
| use warnings; | |
| package Authorization; |
| #!/usr/bin/env perl6 | |
| my $s = IO::Socket::INET.new(:host<abc.net.au>, :port(80)); | |
| $s.print("GET / HTTP/1.0\r\nHost: abc.net.au\r\n\r\n"); | |
| # Too many positionals passed; expected 1 argument but got 2 | |
| # in block <unit> at /home/spacebat/sock.pl6:4 |
| #!/usr/bin/env perl | |
| use Modern::Perl; | |
| use List::Util qw/sum/; | |
| my @elements = (["low", 10], ["mid", 100], ["high", 1000]); | |
| my $accum = 0; | |
| my $total = sum map { | |
| $_->[2] = $accum += $_->[1]; |
| #!/usr/bin/env perl | |
| use Modern::Perl; | |
| use List::Util qw/first sum/; | |
| my @elements = (["low", 10], ["mid", 100], ["high", 1000]); | |
| my $accum = 0; | |
| my $total = sum map { | |
| $_->[2] = $accum += $_->[1]; |
I hereby claim:
To claim this, I am signing this object: