Skip to content

Instantly share code, notes, and snippets.

(define c 3)
(define (add a)
(print "before")
(print (string-split "hoge huga" #\space))
(let1 b 5
(print (+ (mul a b) c)))
(print "after"))
(define (mul a b)
diff --git test/list.scm test/list.scm
index b92343c..f0ff35e 100644
--- test/list.scm
+++ test/list.scm
@@ -84,8 +84,8 @@
(test* "count" 3 (count even? '(3 1 4 1 5 9 2 6 5)))
(test* "count" 3
(count < '(1 2 4 8) '(2 4 6 8 10 12 14 16)))
-(test* "count" 2
- (count < '(3 1 4 1) '#0=(1 10 . #0#)))
diff --git src/load.c src/load.c
index 39a08ba..41fdfa2 100644
--- src/load.c
+++ src/load.c
@@ -202,8 +202,11 @@ static ScmObj load_after(ScmObj *args, int nargs, void *data)
/* C-continuation of the loading */
static ScmObj load_cc(ScmObj result, void **data)
{
+ ScmObj read_proc = SCM_UNDEFINED;
+ SCM_BIND_PROC(read_proc, "read", Scm_GaucheInternalModule());
@aharisu
aharisu / test.c
Created March 20, 2013 04:35
コンパイル方法 gcc `pkg-config --libs quesoglc` -lglut test.c
#include <stdio.h>
#include <GL/glc.h>
#include <GL/glut.h>
int main(int argc, char** argv)
{
GLint ctx;
glutInit(&argc, argv);
@aharisu
aharisu / gist:3803433
Created September 29, 2012 07:33
objdump -d csaw2012reversing
csaw2012reversing: file format elf64-x86-64
Disassembly of section .init:
0000000000400460 <_init>:
400460: 48 83 ec 08 sub $0x8,%rsp
400464: e8 93 00 00 00 callq 4004fc <call_gmon_start>
400469: e8 22 01 00 00 callq 400590 <frame_dummy>
@aharisu
aharisu / window_resize_mode
Created September 12, 2012 13:29
Vim上のWindowサイズ変更をお手軽に変更
function g:window_resize_mode()
echo 'window resize mode'
while 1
let ch = getchar()
if ch == 104 " 104 = h
execute '2wincmd <'
elseif ch == 106 " 106 = j
execute "2wincmd -"
elseif ch == 107 " 107 = k
@aharisu
aharisu / wol.scm
Created June 29, 2012 13:57
Wake-on-LANのマジックパケットを投げつけるだけ
(use gauche.parseopt)
(use gauche.uvector)
(use gauche.net)
(define (usage)
(print "Usage: gosh wol.scm [-m|--mac=<mac-addr>]")
(print "Example: gosh wol.scm -m=1a-2b-3c-4d-5e-6f")
)
(define (main args)
@aharisu
aharisu / gist:2653418
Created May 10, 2012 14:30 — forked from valvallow/gist:2653396
cutで済むならcutを使う派です
(use gauche.generator)
(use gauche.lazy)
(define-syntax chain
(syntax-rules ()
((_ ls proc)(proc ls))
((_ ls proc x ...)
(begin (chain ls proc)
(chain ls x ...)))))
@aharisu
aharisu / gist:2623037
Created May 6, 2012 15:50
gosh_completeのためのvimrc設定
"for gosh_complete
"別バッファからinfo画面を操作するためのキーマップ
nmap <C-K> <Plug>(gosh_info_row_up)
nmap <C-J> <Plug>(gosh_info_row_down)
nmap <C-C> <Plug>(gosh_info_close)
"現在バッファと関連するシンボルをuniteで検索する
nmap gi <Plug>(gosh_info_start_search)
"カーソル位置のテキストを初期入力として、現在バッファと関連するシンボルを検索する
nmap gk <Plug>(gosh_info_start_search_with_cur_keyword)
@aharisu
aharisu / gist:857961
Created March 7, 2011 01:53
TabViewのタブを下側に持ってくる
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout
android:layout_width="fill_parent"