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
| (define-syntax aif | |
| (sc-macro-transformer | |
| (lambda (form env) | |
| `(let ((it ,(make-sc env '() pred))) | |
| (aif* ,@(cddr form)))))) | |
| (define-syntax aif* | |
| (sc-macro-transformer | |
| (lambda (form env) | |
| (let ((then (cadr form)) |
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
| (destructuring-bind ((a b) . c) '((1 2) 3 4 5) (list a b c)) | |
| ; expands to | |
| ((lambda (evaluated@605) | |
| ((lambda (evaluated@605) | |
| ((lambda (a@617) | |
| (begin ((lambda (evaluated@605) | |
| ((lambda (b@619) | |
| (begin |
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
| (import | |
| (scheme base) | |
| (scheme write) | |
| (scheme cxr) | |
| (picrin macro)) | |
| (define-syntax destructuring-bind | |
| (ir-macro-transformer | |
| (lambda (form inject compare) | |
| (let ((pattern (cadr form)) |
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
| # -*- coding: utf-8 -*- | |
| require 'httpclient' | |
| require 'nokogiri' | |
| require 'date' | |
| # 2005/12/16-18 | |
| # 2002/12/14~15 | |
| # 2002/12/15~16 | |
| # |
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
| (define (fib2 n) | |
| (let loop ((stack (list n)) (ans 0)) | |
| (if (null? stack) | |
| ans | |
| (let ((top (car stack))) | |
| (cond ((= top 0) (loop (cdr stack) ans)) | |
| ((= top 1) (loop (cdr stack) (+ ans 1))) | |
| (else (loop `(,(- top 1) ,(- top 2) ,@(cdr stack)) ans))))))) |
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
| (define-syntax let | |
| (rsc-macro-transformer | |
| (lambda (form mac-env) | |
| (if (symbol? (cadr form)) | |
| ((lambda (name bindings body) | |
| (list (make-syntactic-closure mac-env '() 'let) | |
| '() | |
| (list (make-syntactic-closure mac-env '() 'define) | |
| name | |
| (cons (make-syntactic-closure mac-env '() 'lambda) |
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
| helmold$ make test-parser | |
| clang++ -I./include -std=c++11 -stdlib=libc++ -lc++ -g -Wall -Wextra -o bin/test-parser t/test-parser.cpp src/parser.cpp src/object.cpp | |
| t/test-parser.cpp:1:10: fatal error: 'iostream' file not found | |
| #include <iostream> | |
| ^ | |
| 1 error generated. | |
| make: *** [test-parser] Error 1 |
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
| (defpackage :rosalind | |
| (:use :common-lisp | |
| :iterate) | |
| (:shadow :read-line | |
| :read-char | |
| :peek-char)) | |
| (in-package :rosalind) | |
| (defvar *default-input-path* "E:\\Documents\\downloads\\") |
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
| (defpackage :my-package | |
| (:use :common-lisp | |
| :iterate) | |
| (:export :my-func1 | |
| :my-func2)) | |
| (defun my-func1 (x y) | |
| (+ x y)) | |
| (defun my-func2 (list) |