Skip to content

Instantly share code, notes, and snippets.

@SaitoAtsushi
SaitoAtsushi / patch.patch
Created January 26, 2015 11:16
JSON パーサを R6RS 化するパッチ
--- parser.scm.org 2015-01-26 11:13:28 +0900
+++ parser.scm 2015-01-26 18:28:49 +0900
@@ -25,33 +25,20 @@
;;; Code:
-(define-module (json parser)
- #:use-module (ice-9 rdelim)
- #:use-module (rnrs bytevectors)
- #:use-module (srfi srfi-9)
@SaitoAtsushi
SaitoAtsushi / pl0-test.scm
Created February 14, 2015 11:36
Gauche を PL/0 処理系にする
;;; -*- mode: gauche -*-
(use pl0)
#!pl0
CONST m = 7, n = 85;
VAR x, y, z, q, r;
PROCEDURE gcd;
(define-library (casl parser)
(export casl-parse-error casl-parse)
(import (scheme base)
(scheme char)
(casl peg))
(begin
(define (subsequent-letter? ch)
(or (char-alphabetic? ch) (char-numeric? ch)))
(define %initial-letter
@SaitoAtsushi
SaitoAtsushi / pandoric.sld
Last active August 29, 2015 14:27
Error sample for Sagittarius 0.6.6
(define-library (pandoric)
(export define-pandoric-procedure pandoric-ref pandoric-set!)
(import (scheme base))
(begin
(define-syntax flag-a (syntax-rules ()))
(define-syntax flag-m (syntax-rules ()))
(define-syntax %dpp
(syntax-rules ()
module Main (main) where
import TL1Parse
import TL1Lex
import System.Console.GetOpt
import System.Environment
import Data.Bool
import System.IO
opt :: [OptDescr Bool]
opt = []
@SaitoAtsushi
SaitoAtsushi / test.scm
Created October 16, 2015 18:24
Saggitarius 0.6.9 で変なメッセージが出る
(import (rnrs) (rfc http) (rfc base64))
(define (basic-auth-string user password)
(string-append "Basic "
(base64-encode-string (string-append user ":" password))))
(define (access)
(receive (status header body)
(http-get "htaccess.cman.jp"
"/sample_go/basic/"
@SaitoAtsushi
SaitoAtsushi / word2vec-mingw32.patch
Last active November 21, 2015 10:22
word2vec を MinGW32 でビルドするためのパッチ
Index: word2phrase.c
===================================================================
--- word2phrase.c (リビジョン 42)
+++ word2phrase.c (作業コピー)
@@ -16,8 +16,9 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <pthread.h>
+#include <inttypes.h>
diff --git a/src/gauche.h b/src/gauche.h
index 7b12cb1..bb3fd6e 100644
--- a/src/gauche.h
+++ b/src/gauche.h
@@ -74,13 +74,6 @@
# endif
#endif
-/* For Windows platforms, we need some compatibility tricks.
- This defines GAUCHE_WINDOWS preprocessor symbol.
@SaitoAtsushi
SaitoAtsushi / picrin-mingw.diff
Created February 3, 2016 19:34
MinGW32 で picrin のビルドを通すパッチ
diff --git a/contrib/10.roundtrip/emyg_atod.c b/contrib/10.roundtrip/emyg_atod.c
index f742e15..f69c50e 100644
--- a/contrib/10.roundtrip/emyg_atod.c
+++ b/contrib/10.roundtrip/emyg_atod.c
@@ -44,6 +44,10 @@
#include <ctype.h> // used by emyg_strtod
#include <math.h> // scalb()
+#ifdef __MINGW32__
+#define scalb _scalb
@SaitoAtsushi
SaitoAtsushi / testcase.cpp
Created April 4, 2016 16:45
clang で通るけど gcc でエラーになる
template<class T>
class foo {
friend void T::qux(void);
private:
int baz;
public:
foo(void) : baz(1){}
};
#include <iostream>