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
diff -r dc3cb8ca8a4d sitelib/json.scm | |
--- a/sitelib/json.scm Wed Sep 04 22:14:31 2013 +0200 | |
+++ b/sitelib/json.scm Thu Sep 05 13:33:27 2013 +0900 | |
@@ -128,16 +128,35 @@ | |
(if (char=? (parse-results-token-value results) (string-ref str pos)) | |
(loop (+ pos 1) (parse-results-next results)) | |
(make-expected-result (parse-results-position starting-results) str)))))) | |
+ (define (interpret-string-unicode-escape results k) | |
+ (let loop ((i 0) | |
+ (acc '()) |
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 Data.List | |
data Mat a = Mat a a a a deriving (Show, Eq) | |
instance (Num a) => Num (Mat a) where | |
(Mat a b c d) * (Mat p q r s) = Mat (a*p+b*r) (a*q+b*s) (c*p+d*r) (c*q+d*s) | |
(Mat a b c d) + (Mat p q r s) = Mat (a+p) (b+q) (c+r) (d+s) | |
abs=undefined | |
signum=undefined | |
fromInteger x = let y = fromInteger x in (Mat y y y y) |
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
module Data.Bignum (Bignum, toBignum) where | |
import Data.Word | |
import Data.Bits | |
import Data.List | |
newtype Bignum = Bignum {bignum_list :: [Word32]} deriving Eq | |
class IsBignum a where |
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
#ifndef L | |
#define L 5 /* 段数を指定する。 */ | |
#endif | |
#define N ((L+1)*L/2) | |
static inline int pop_count(int x) { | |
static const int const table[] = | |
{0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, | |
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, |
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
#!r6rs | |
;; Sagittarius 0.5.0 のバグ? | |
(import (rnrs)) | |
(define-syntax let/scope | |
(lambda(x) | |
(syntax-case x () | |
((k scope-name body ...) | |
#'(let-syntax | |
((scope-name |
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
#!r6rs | |
;; petite chez scheme と ypsilon で挙動が異なる | |
(library (bound) | |
(export if-bound bound?) | |
(import (rnrs)) | |
(define-syntax if-bound | |
(lambda(stx) | |
(syntax-case stx () | |
((_ id consequent) |
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
#!r6rs | |
(library (library-a) | |
(export with-library-a) | |
(import (rnrs) (library-accessor)) | |
(define x 'library-a) | |
(define-accessor-for-outer-of-library with-library-a) | |
) |
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
#!r6rs | |
(library (reinterpret) | |
(export reinterpret) | |
(import (rnrs)) | |
(define-syntax reinterpret | |
(lambda(stx) | |
(syntax-case stx () | |
((_ x) | |
(free-identifier=? (datum->syntax #'k (syntax->datum #'x)) #'x))))) |
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
#!r6rs | |
(import (rnrs) | |
(pattern-match-lambda)) | |
(define-syntax exam | |
(syntax-rules () | |
((_ form expect) | |
(begin | |
(display 'form) | |
(display " ... ") |
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-library (pattern-match-lambda) | |
(export pattern-match-lambda) | |
(import (scheme base)) | |
(begin | |
(define-syntax if-identifier | |
(syntax-rules () | |
((_ condition seq alt) | |
(let-syntax ((foo (syntax-rules () ((_) seq)))) | |
(let-syntax ((test (syntax-rules () |