Skip to content

Instantly share code, notes, and snippets.

@okuoku
okuoku / gist:020f3dbbf7d00c91d21c
Last active August 29, 2015 14:17
r6r7compare
R6LibName Sym R7LibName
=============================================================================================
(rnrs base) number->string (scheme base)
(rnrs base) error (scheme base)
(rnrs unicode) char-upcase (scheme char)
(rnrs unicode) char-downcase (scheme char)
(rnrs unicode) char-foldcase (scheme char)
(rnrs unicode) char-ci=? (scheme char)
(rnrs unicode) char-ci<? (scheme char)
(rnrs unicode) char-ci>? (scheme char)
(import (rnrs)
(only (srfi :1) lset-difference)
(srfi :8)
(shorten)
(yuni util files)
(yuni text tabular))
(define (filt-r7 sexp) (filter (lambda (e) (pair? (car e))) sexp))
(define (genall dic)
@okuoku
okuoku / gist:e51fd2bfc88d67172dff
Created June 3, 2015 17:19
call-stubs.inc.c from latest NMosh
typedef int (*func_ip_i_t)(int, void*);
void
callstub_ip_i(func_ip_i_t func, uint64_t* args, void* ret){
*(intptr_t*)ret = func(*(int *)(char *)&args[0], *(void* *)(char *)&args[1]);
}
typedef int (*func__i_t)();
void
callstub__i(func__i_t func, uint64_t* args, void* ret){
*(intptr_t*)ret = func();
@okuoku
okuoku / gist:f9b465452b0aa9c49b8f
Created June 6, 2015 19:52
Generated SDL2 binding for yuni
#include "SDL.h"
#include <yuniffi/stub/_top.h>
#define EXPORT_SDL_MAIN_NEEDED(k)\
YUNIFFI_EXPORTCLASS_CONST_SINT(k, "SDL_MAIN_NEEDED", SDL_MAIN_NEEDED)
#define EXPORT_SDL_ICONV_ERROR(k)\
YUNIFFI_EXPORTCLASS_CONST_UINT(k, "SDL_ICONV_ERROR", SDL_ICONV_ERROR)
#define EXPORT_SDL_ICONV_E2BIG(k)\
@okuoku
okuoku / gist:3f2e469497bbf12575e8
Created July 19, 2015 17:21
Compiler of SECDR scheme (GPL)
;;
;; compiler.scm
;;
;;;; SECDR Compiler
;;
;; Date written 11-Feb-1990 by Atsushi Moriwaki
;; Date revised 20-Feb-1990 by Atsushi Moriwaki
;; Date revised 06-Mar-1990 by Atsushi Moriwaki
;; Date revised 31-Jul-1992 by Shoichi Hayashi
# Reader error: NRx7xxxx
NRE70001:
J: 表記エラーが多すぎるため読み取りを中止しました。
NRE70002:
J: inline hex escapeがセミコロンによって終端されていません。
NRE70003:
J: inline hex escapeによって指定された値は有効な文字ではありません。
@okuoku
okuoku / check3.scm
Created February 11, 2016 18:07
Kawa --no-inline requirement
(define-library (minitype)
(export
miniobj-minitype-ref
miniobj-minitype-set!
make-minitype-obj)
(import (scheme base) (scheme write))
(begin
(define (make-minitype-obj)
(vector "UNINITIALIZED_x" "UNINITIALIZED_y"))
@okuoku
okuoku / sorted.scm
Created June 3, 2017 21:21
Sorted (yuni scheme) procedures
;; "4.2.6. Dynamic bindings"
;; parameterize is a syntax
make-parameter
;; "6.1. Equivalence predicates"
eqv? eq? equal?
;; "6.2.6. Numerical operations"
;; Skip: rational? rationalize infinite? numerator denominator
;; make-rectangular make-polar real-part imag-part magnitude angle
@okuoku
okuoku / check.scm
Created June 11, 2017 08:23
Unsuccessfull make-coreops-fake on Gauche
(define (make-coreops-fake)
(define-syntax define-query0
(syntax-rules ()
((_ q (sym0 sym1) ...)
(define (q symbol)
(case symbol
((sym0) sym1)
...
(else