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 (scheme base) | |
| (scheme write)) | |
| (define hoge 3) | |
| (define-syntax foo | |
| (syntax-rules (hoge) | |
| ((_ hoge) | |
| (write "You got")) | |
| ((_ bar) |
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 (scheme base) | |
| (scheme write)) | |
| (define-syntax foo | |
| (syntax-rules (hoge) | |
| ((_ hoge) | |
| (write "You got")) | |
| ((_ bar) | |
| (write 'bar)))) |
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
| (defpackage interpole | |
| (:use :common-lisp) | |
| (:use :iterate)) | |
| (in-package interpole) | |
| (declaim (optimize (speed 0) (debug 3) (safety 3))) | |
| ;;; lagrange | |
| (defun lagrange-interpole (xs ys) |
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
| var sh = new ActiveXObject( "WScript.Shell" ); | |
| sh.Run("C:\\cygwin64\\bin\\ssh.exe -Y cetinje \"LANG=ja_JP.utf-8 lxterminal\"", 0); |
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-syntax quota | |
| (syntax-rules () | |
| ((_ a) 'a))) | |
| (define-syntax hoge | |
| (syntax-rules () | |
| ((_) (quota tako)))) |
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-syntax hoge | |
| (er-macro-transformer (lambda (expr rename compare) | |
| (list (rename 'quote) | |
| (rename 'list))))) | |
| (hoge) | |
| ; => (list@29) |
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
| library ieee; | |
| use ieee.std_logic_1164.all; | |
| use ieee.numeric_std.all; | |
| library work; | |
| use work.utility.all; | |
| entity fadd is | |
| port ( clk : in std_logic; | |
| i1 : in unsigned(31 downto 0); |
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 (subst old new tree) | |
| (cond ((eq? old tree) new) | |
| ((pair? tree) | |
| (cons (subst old new (car tree)) | |
| (subst old new (cdr tree)))) | |
| (else tree))) | |
| (define-syntax x2y | |
| (ir-macro-transformer | |
| (lambda (form r compare) |
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
| > (let ((x 1)) | |
| * (cond ((even? x) => (lambda (m) m)) | |
| * (else x))) | |
| => #f | |
| > (macroexpand '(let ((x 1)) | |
| * (cond ((even? x) => (lambda (m) m)) | |
| * (else x))) | |
| * ) | |
| => ((lambda (x@2472) ((lambda (x@2473) | |
| (if x@2473 |
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
| (syntax-rules () ((when test stmt1 stmt2 ...) (if test (begin stmt1 stmt2 ...)))) | |
| ; expand to | |
| (er-macro-transformer@187 | |
| (lambda (expr rename cmp) | |
| (let@265 ((test/0 ()) (stmt1/0 ()) (stmt2/1 ())) | |
| (let@265 ((result (call/cc@152 (lambda (exit) (let@265 ((expr (cdr@8 expr))) (begin (if (pair?@5 expr) (let@265 ((expr (car@7 expr))) (set! test/0 expr)) (exit #f)) (if (pair?@5 (cdr@8 expr)) (let@265 ((expr (car@7 (cdr@8 expr)))) (set! stmt1/0 expr)) (exit #f)) (let@265 ((expr (let@265 loop ((a ()) (d (cdr@8 (cdr@8 expr)))) (if (pair?@5 d) (loop (cons@6 (car@7 d) a) (cdr@8 d)) (cons@6 d a))))) (begin (let@265 ((expr (car@7 expr))) (if (not@3 (eqv?@1 '() expr)) (exit #f))) (let@265 ((expr (cdr@8 expr))) (let@265 loop ((expr expr)) (if (not@3 (null?@15 expr)) (let@265 ((stmt2/0 '())) (let@265 ((expr (car@7 expr))) (set! stmt2/0 expr)) (set! stmt2/1 (cons@6 stmt2/0 stmt2/1)) (loop (cdr@8 expr))))))))) #t))))) | |
| (if result | |
| (quasiquote@328 ((unquote@460 (rena |