Chez Scheme Version 8.4 tar -xzvf pcsv8.4-ti3osx.tar.gz cd csv8.4/costom ./configure --installprefix=~/local --installman=~/local/share/man make make install ãã㨠petite 㨠scheme-script ãã¤ã³ã¹ãã¼ã«ããããroot権éã«chownãããã¨ããâ¦
ãããã ><>ã¨ããé£è§£ããã°ã©ãã³ã°è¨èªãæã´ã«ãå ´ã«å ¥ã£ãã®ã§ãå ¥éãããè¨èªã®ååä¸ãã°ã°ã©ããªãã£ãé常ã«ä½ãæ¥æ¬èªã®æ å ±ãè¦å½ãããªãã£ãã®ã§ãããã«æ¥æ¬èªã§èªåã®><>å ¥éã¸ã®éä¸ãè¨ããããã¾ã§åå¿è ã調ã¹ãªããæ¸ããæç« ãªã®ã§ãâ¦
Schemeã§ãã㨠(define (hungry x) hungry) ã¿ãããªãã¤ãããã¾ã§ã¯ã§ãããåè: https://github.com/jstolarek/sandbox/blob/master/haskell/Hungry.hs Prelude> :set -XRankNTypes Prelude> data Hungry = Hungry { (%) :: forall b. b -> Hungry } Prâ¦
æ¦è¦ æ¨æ¥ãèªåèªèº«ãåºåããHaskellããã°ã©ã ãçæããOCamlããã°ã©ã ãçæããSchemeããã°ã©ã ãçæããRubyããã°ã©ã ãçæããJavaScriptããã°ã©ã ãçæããCããã°ã©ã ãæ¸ããã #include<stdio.h> int main(){char*g="var p=print;p('puts %%^(form</stdio.h>â¦
enumåãããã®ä¸ã®åã¸ã®ãã£ã¹ããã underlying_cast ãæ¸ããã #include <cinttypes> #include <type_traits> #include <array> #include <cstdio> template <class E> constexpr typename std::underlying_type<E>::type underlying_cast(E e) noexcept { return static_cast<typename std::underlying_type<E>::type>(e); } enum class Kiâ¦</typename></e></class></cstdio></array></type_traits></cinttypes>
#define STR(a) #a #define STR_(a) STR(a) #define CONCAT(a,b) a##b #define CONCAT_(a,b) CONCAT(a,b) #define M1(a) STR(CONCAT(a, __LINE__)) #define M2(a) STR_(CONCAT(a, __LINE__)) #define M3(a) STR(CONCAT_(a, __LINE__)) #define M4(a) STR_(COâ¦
å¢ãä½ã£ã¦ãé©ç¨ã§ããã¡ã½ããããªããã° method-missing ãå¼ã³åºããæ©è½ãä½ã£ã¦ã¿ãï¼ (define-generic method-missing) (define-class <method-missing-generic> (<generic>) ()) (define-method apply-methods ((gf <method-missing-generic>) methods args) (if (null? methods) (apply method-missing gf arg</method-missing-generic></generic></method-missing-generic>â¦
ãã£ãã: ãã³ã¾ ãããèªãã§polyglotãããã¼ã£ã¦æã£ãï¼ ä»åã®ã³ã³ã»ãã㯠åãã¦ãªã®ã§ããããHello, world! 好ããªè¨èªãçãè¾¼ã 140æåä»¥ä¸ ä»¥ä¸ï¼Schemeã¨è¨ãã¤ã¤Gauche決ãæã¡ã§ããï¼ ã½ã¼ã¹ã³ã¼ã ã§ãããã£ãã®ãããï¼ ;(#)={-"^<"v 'â¦
Racketã®ç¶ç¶ãã©ããªã£ã¦ããã®ãï¼Racketã®ããã¥ã¡ã³ããèªã¿ã¤ã¤åãã£ããã¨ãã¾ã¨ããï¼ (注æ: ãã®è¨äºã¯ç¶ç¶ã®è§£èª¬ã§ã¯ãªãï¼å¯§ãç¶ç¶èªä½ã¯å¤§ä½åãã£ã¦ããåæã§é²ãã) ã¾ãï¼ä¸»ãªç¶ç¶ããªããã£ã´ã«ã¤ãã¦ç°¡åã«èª¬æããï¼æ¬¡ã«ï¼çµã¿åãããâ¦
MIT/GNU Scheme - GNU Project - Free Software Foundation ä»åã¯ç¡æ°åãªã®ã¨ãªãããããããã£ã¦ããåãããªãã®ã§ãã¤ããªãå ¥ããï¼"Compiled on OS X 10.6" ã ãï¼x86-64ã®ããã¦ã³ãã¼ããã¦ã³ãã¼ãã¦çµããï¼ ãã¨æããããã¹ã«ã³ãã³ãå ¥ã£ã¦ã¦â¦
s id id idã«åãä»ããªãï¼ ghci> let s f g h = f h $ g h ghci> :t s id id id <interactive>:1:5: Occurs check: cannot construct the infinite type: a = a -> b Probable cause: `id' is applied to too few arguments In the second argument of `s', namely `id'</interactive>â¦
ãTypes and Programming Languagesã(é称TAPL)ã®è¨³æ¬ï¼ãåã·ã¹ãã å ¥é âããã°ã©ãã³ã°è¨èªã¨åã®çè«âããèªãã§ããï¼èªæ¸æ¥è¨ãã¤ããã¨ããããããªããã¨æãç«ã£ããé¢åèããªã£ãï¼èªã¿å§ãã¯2/4é ï¼10ç« ã¾ã§èªãã ï¼ åºæã«ç« ã®ä¾åé¢ä¿ãè¼ã£â¦
c-wrapperï¼c-wrapper ã¯æ´æ°ããã¦ããªããã© http://hg.koguro.net/c-wrapper ã§æ´æ°ããã¦ããï¼ãã¦ã³ãã¼ãâã¿ã°ãããã¦ã³ãã¼ãã§ããï¼ ./DIST gen ./configure CC=/usr/bin/gcc make DYLD_INSERT_LIBRARIES=/usr/lib/libffi.dylib make checkæ®éã«â¦
Either a b(ä½ãaã¨bã¯ä½ããã®å ±éã®å¶ç´ãæã¤)ã«é©ç¨ã§ãã f g = either g g ã¨ããé¢æ°ãæ¸ããã¨ãããï¼æ¸ããªãã£ãï¼ç¹å®ã®åã¯ã©ã¹ã«éå®ããã°æ¸ããã¨ãã§ããï¼ {-# LANGUAGE RankNTypes #-} fshow :: (Show a, Show b) => (forall c. (Show c)â¦
æè¿ã®Haskellã«ã¯ãã¿ã¼ã³ã¬ã¼ãã¨ãããã®ããããããï¼ {-# LANGUAGE PatternGuards #-} addLookup alist x y | Just m <- lookup x alist , Just n <- lookup y alist = m + n | otherwise = 0 main = print $ addLookup [(1, 2), (3, 4)] 1 3 -- => 6 â¦
Ruby2.0.0-p195ãã¤ã³ã¹ãã¼ã«ï¼ makeãã㨠gcc: installation problem, cannot exec '/usr/local/bin/i686-apple-darwin9-gcc-4.0.1': No such file or directory dtrace: failed to compile script probes.d: Preprocessor failed to process input progrâ¦
Haskellã§Parsecã使ã£ã¦ã¿ããã¨æãã¤ã¤ã¤ã³ã¹ãã¼ã«ãããã«ãå¤ä»£OSæ ã«cabalãå ¥ã£ã¦ããªãã®ã§è«¦ãã¦ãããï¼ããã£ããcabalãæåã§å ¥ããã°ãããããã®ã§ä¾åã©ã¤ãã©ãªãå ¥ãã¦ããããã¤ã®éã«ãParsecãå ¥ã£ã¦ããï¼ ã¨ããããã§ï¼å¢ãä½ã£ã¦ â¦
shift/reset ã¨åçç°å¢ã®é¢ä¿ã«ã¤ãã¦ããããèãã¦ããæã«åºã¦ããå¯ç£ç©ï¼ (use util.match) (define (capture/de proc) (match (let/cc de (list (proc de))) ((r) r) (thunk (thunk)))) (define (with/de de thunk) (let/cc cont (de (.$ cont thunk)â¦
(define-syntax alet1 (sc-macro-transformer (lambda (expr use-env) (let ((it-expr (cadr expr)) (var (caddr expr)) (expr1 (cadddr expr)) (body (car (cddddr expr)))) `(let ((it ,(make-syntactic-closure use-env '() it-expr)) (,var ,(make-syntaâ¦
(make-syntactic-closure environment free-names form) ã® free-names ã¯ï¼let ã§å ãã¤ã¡ã¼ã¸ã§ãããã ãããï¼ (let ((x 1)) (let-syntax ((foo (sc-macro-transformer (lambda (expr env) (let ((var (cadr expr))) (make-syntactic-closure var (list â¦
ãã±ã¢ã³ééã®ãªãªã¸ãã«ã«ã¼ã«ããã¤ãã¼ã«ãããã®ãã£ã©ã©ã³ã¯ãé©å½ã«ä½ã£ã¦ã¿ãï¼ ãã¤ãã¼ã«ããã®ã«ã¼ã«ã¯ãã³ãã³ãã¦ã«ãã2000ãåºæºã«ä»¥ä¸ã®è¿½å ã«ã¼ã«: ãã¿ããªã¼ ã¹ãã¢ã¼ ãã¸ã§ãã ã©ãã¿ ãªãããªã« ãã¯ãªã³ ãã©ã»ã¯ã ã«ã¢ãã® ãããªâ¦
texi2html 1.70 ãå ¥ã£ã¦ããã®ã ãã©ãã¾ããããªãã£ã(1æéçµã£ã¦ãçµãããªãã£ã)ã®ã§ texi2html 1.82 ãã¤ã³ã¹ãã¼ã«ï¼ã½ã¼ã¹ã®docä¸ã§ make htmls ã§40ç§ç¨ã§ã§ããï¼make html ã¨ããã¨ã²ã¨ã¾ã¨ãã«ãªã£ãhtmlãåºæ¥ä¸ããï¼texi2htmlã®--splitãªãâ¦
Gaucheã®class.cããå¼ç¨ï¼ /* * compute-cpl */ ScmObj Scm_ComputeCPL(ScmClass *klass) { ScmObj seqh = SCM_NIL, seqt = SCM_NIL, ds, dp, result; /* a trick to ensure we have <object> <top> at the end of CPL. */ ds = Scm_Delete(SCM_OBJ(SCM_CLASS_OBJECT), k</top></object>â¦
(use gauche.collection) (use gauche.mop.singleton) (define-class <zero-collection-meta> (<singleton-meta>) ()) (define-class <zero-collection> (<collection>) () :metaclass <zero-collection-meta>) (define-method call-with-iterator ((class <zero-collection>) proc :key start) (proc (^ () #t) (^ () (errâ¦</zero-collection></zero-collection-meta></collection></zero-collection></singleton-meta></zero-collection-meta>
ååããèé¨ã® i ã®ä»£ããã«!ã使ããããã«ãªã£ãã®ã¨ré²æ°(r>1)ã使ããããã«ãªã£ãï¼ã㨠$try ã足ããªãæããã£ãã®ã§è¶³ãããï¼ææ©ï¼R5RSã®æ°å¤ãªãã©ã«ã£ã½ããã®ã§ã¯ãªããªã£ã¦ãã¦ããï¼ ååã®36é²æ°ã®èé¨ãæ±ãã¨ããåé¡ï¼ã³ã¡ã³ããé ããâ¦
R5RSã®æ°å¤ãªãã©ã«ã®ãµãã»ãããæ¡å¼µãããã®ã®ãã¼ã¶ãparser.pegã§æ¸ããï¼å ·ä½çã«ã¯å°æåãã使ããªãã®ã¨ 123### ãåã£ã¦å°æ°ã10é²ä»¥å¤ã§ãæ¸ããããã«ããæãï¼ãã¨36é²æ°ã¨ææ°ãã¼ã«ã«^ã追å ï¼ parser.pegã¯undocumentedã§ããåãããªãã®â¦
ããªããç¨ Haskell golf ã®æç§æ¸ãèªãã§ã俺ãããããã®æ¸ãããï¼ãã¨æã£ã¦æ¸ãã¦ã¿ãï¼(æã£ã¦ããæ¸ãã¾ã§ã«1å¹´ãããçµã£ã¦ããã©) ã¢ããã¥ã¢ã´ã«ãã¡ã¼ãªã®ã§è³ãã¬æãããããã ãã©ï¼ä»å¾ã®Schemeçã¨ããªããçã®çãä¸ãããé¡ã£ã¦ãã®æç« â¦
æåï¼ç¡åé¢æ°ã§æ¸ããã¨ãããï¼ã©ãããã°å¤ç¸çã«ãªã£ã¦ãããã®ãããããªãã¦ï¼ããã£ã¦ããååãä»ããã°ããã¨ãããã¨ã ã£ãï¼ ã¨ãããï¼ scala> def id[T](x: T) = x id: [T](x: T)T scala> id _ res0: Nothing => Nothing = <function1> scala> (id _)(42) <console></console></function1>â¦
ãµãããã¼ï¼äº¬é½å¤§å¦ã·ãã·ããµã¼ã¯ã«ï¼ åç»å庫ã«åå ï¼ æå人ãå°ãªãã£ãã®ã§äºé¸çªç ´ããï¼ææ¥æ±å¤§ã§å¤§ä¼ããããããã¦ãã®å½±é¿ãªãã ã¨ãï¼ äºé¸16å(åç7å²ç¨åº¦ï¼)ï¼æºæ±ºåãªã¼ã°1å6æ(2-13)ã§æéï¼ äºé¸15åã®äººã¯å»¶é·æ¦ããã£ãããã ï¼ ä»â¦
ã¨ã©ãã¹ããã¹ã®ç¯© (define (divisor? x y) (eqv? 0 (remainder x y))) (define-constant +primes+ (stream-cons 2 (stream-filter prime? (stream-iota -1 3 2)))) ;; (define (prime? n) ;; (not (stream-any (cut divisor? n <>) (stream-take-while (cuâ¦