This file contains 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 (pick-toothless ls) | |
(let rec ((ls ls)(acc '())) | |
(if (or (null? ls) | |
(null? (cdr ls))) | |
(reverse acc) | |
(let1 next (+ (car ls) 1) | |
(if (= next (cadr ls)) | |
(rec (cdr ls) acc) | |
(rec (cons next (cdr ls)) | |
(cons next acc))))))) |
This file contains 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
(use util.match) | |
(define-syntax %def | |
(syntax-rules (->) | |
((_ (a ...) (b ...) -> x r ...) | |
(%def (a ... ((b ...) x)) () r ...)) | |
((_ (a ...) (b ...) x r ...) | |
(%def (a ...) (b ... x) r ...)) | |
((_ (a ...) ()) | |
(match-lambda* a ...)) |
This file contains 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
function Primes() { | |
this.index=3; | |
this.nums=[2]; | |
} | |
Primes.prototype.next=function() { | |
var i; | |
for(i=this.index; !(this.primep(i)); i++); | |
this.index=i+1; | |
this.nums.push(i); |
This file contains 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
;; http://common-lisp-users.jp/index.cgi?M-99 | |
(define-syntax inc1 | |
(syntax-rules () | |
((_ v) | |
(set! v (+ v 1))))) | |
(define-syntax when | |
(syntax-rules () | |
((_ p b0 b1 ...) |
This file contains 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
#!/usr/bin/env gosh | |
;; -*- coding: utf-8-unix ; mode: gauche; -*- | |
(use rfc.http) | |
(use rfc.json) | |
(use srfi-43) | |
(use gauche.collection) | |
(use text.tree) | |
(use sxml.tools) | |
(use sxml.serializer) |
This file contains 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-optionals | |
(syntax-rules () | |
((_ args ((var default) rest ... . restarg) body ...) | |
(let* ((tmp args) | |
(var (if (null? tmp) default (car tmp)))) | |
(let-optionals (if (null? tmp) '() (cdr tmp)) | |
(rest ... . restarg) | |
body ...))) | |
((_ args () body ...) | |
(begin body ...)) |
This file contains 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-optionals* | |
(syntax-rules () | |
((_ a ((v d) . r) . b) | |
(let* ((t a) | |
(v (if (null? t) d (car t)))) | |
(let-optionals* (if (null? t) '() (cdr t)) r . b))) | |
((_ a () . b) | |
(begin . b)) | |
((_ a (v . r) . b) | |
(let-optionals* a ((v #f) . r) . b)) |
This file contains 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
Index: src/sysdep.h | |
=================================================================== | |
--- src/sysdep.h (リビジョン 506) | |
+++ src/sysdep.h (作業コピー) | |
@@ -114,6 +114,7 @@ | |
#define VALUE_NAN std::numeric_limits<double>::quiet_NaN() | |
#define VALUE_INF std::numeric_limits<double>::infinity() | |
+ #ifndef __MINGW32__ | |
#define INT8_MIN _I8_MIN |
This file contains 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
--- binary/pack.scm.org Sun Apr 01 17:09:10 2012 | |
+++ binary/pack.scm Wed Jan 23 16:18:05 2013 | |
@@ -1,6 +1,8 @@ | |
+#!r6rs | |
;;;; binary.pack -- packing and unpacking binary data | |
;;; Author: Alex Shinn <[email protected]> | |
+;;; Modified by SAITO Atsushi for Sagittarius scheme | |
;; It is really insupportable that every hen lays an egg of a different |
This file contains 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 (bound helper) | |
(export make-definition) | |
(import (rnrs)) | |
(define-syntax make-definition | |
(lambda(stx2) | |
(syntax-case stx2 () | |
((_ if-bound bound?) |
OlderNewer