2011-01-01ãã1å¹´éã®è¨äºä¸è¦§
ããªããç¨ 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â¦
F# ã® |> æ¼ç®åããã£ãããã®ã§ãHaskell ã§ä½ã£ã¦ã¿ãã infixl 0 |> (|>) :: a -> (a -> b) -> b a |> f = f a 以ä¸ã®ããã«ã·ã§ã«ã®ãã¤ãã®ãããªæãã§ä½¿ãã foo :: String foo = [1..100] |> map (*2) |> filter (\x -> x `mod` 6 == 0) |> sum |> â¦
CC=/usr/bin/gcc ./configure --prefix=/usr/local make prefix=/usr/local sudo make prefix=/usr/local installæå³ããããããã© configure ã«ãã prefix=/usr/local ã¤ãã¦ãªãã¨ãã¼ã ã«ã¤ã³ã¹ãã¼ã«ããã¦ãã¾ãã®ã§å ¨é¨ã¤ããï¼ gccãã¤ã³ã¹ãã¼ã«â¦
CC=/usr/bin/gcc ./configure --prefix=/usr/local make sudo make installâä½æ ããã¼ã ã«ã¤ã³ã¹ãã¼ã«ããã âsudo make uninstall âmake: *** No rule to make target `uninstall'. Stop. 馬鹿ãªã®ï¼æ»ã¬ã®ï¼
gccããã¦ã³ãã¼ãï¼å±é GMPã¨MPFRã¨MPCããã¦ã³ãã¼ãï¼å±éãã¦gccãå±éãããã£ã¬ã¯ããªã«æ¾ãè¾¼ã configureï¼makeï¼make install ã§ã§ããï¼æåã¯GMPï¼MPFRï¼MPCãããããmakeãã¦ããã©gccã®configureã®æã«ä½æ ãã©ããã¦ãè¦ä»ãã¦ãããªãã£ã(â¦
rejectã¯ããã©ã«ãå¤ãåãç¶ããï¼selectã¯åãç¶ããªãï¼ Hash.new(42).select { nil }[0] # => nil Hash.new(42).reject { nil }[0] # => 42 ãªãã¡ã¬ã³ã¹ããã¥ã¢ã«ã®èª¬æã®å¾®å¦ãªéãã¯ï¼ãã®æåã®éãããæ¥ããã®ãªã®ãï¼ key, value ã®ãã¢ã«ã¤ãâ¦
Intã¯ä½æ Orderedãããªãã®ï¼ ã¾ããHello, world!ã®æ¬¡ã«
".".TABã¨æã¤ã¨ä»¥ä¸ã®ããã«ãªãï¼ãã°ï¼ scala> ".".<console>:1: error: unclosed string literal " ^"a".TABãªãæå¾ éãã®åä½ãããï¼ ãã¨ãããã¬ãã«ã¡ã½ãã(æ£ç¢ºã«ã¯ãªãã¨å¼ã¶ã®ãå¿ãã)ãè£å®ãããªããã®ãããï¼readLineã¨ãï¼ ããããreadLineã«é£</console>â¦
ã¯ãã¹ãã¡ã¤ã³ã©ãããåãã¡ã¤ã³ã§ãåããªãã£ã alertã¯å ¥ã£ã¦ãªã (ã¯ãã¹ãã¡ã¤ã³ã§ã)ãªã¯ã¨ã¹ãã¯å±ãã¦ããã¿ãããªãã ãã©onloadãonreadystatechangeãonerrorãç¡åå¿ ãã¿ãµ (6/10追è¨) åèµ·åãããåãããçªç¶åããªããªã£ãããã¦ã¾ãã¾ãâ¦
http://e-arrows.sakura.ne.jp/2010/12/closure-library-on-js2-mode.htmlãåèã«è¨å®ãã¦ããã®ã ãã©ï¼ããã ã¨caseã®ä¸èº«ã®ã¤ã³ãã³ãããã¾ããããªãã£ãï¼ myapp.main = function() { var Fruit = some.namespace.Fruit; switch (fruit) { case Fruitâ¦
ãã¼ãã¤ã³ããã¦ç´æ¥å¼ã¶ã¨(error "pulldown-width accessing a non-pulldown") anything-call-sourceçµç±ã ã¨(wrong-type-argument arrayp nil)ã§ç´åãpulldown-width(nil) ãæä¸ã (追è¨) ä¸ç¬ï¼æ®éã«anythingããã ãã§(wrong-type-argument arrayp nâ¦
(rnrs records syntactic)ã¨srfi-17ãçµã¿åããã¦ä½¿ãããã£ããã ãã©ï¼ã©ããæåã§setterãset!ããªããã°ãªããªãããã ã£ãã®ã§ï¼ãã¯ãã®åå¼·ã¤ãã§ã«setterãset!ãã¦ããããã®ãæ¸ããï¼ æåã¯æç¶ãã§æ¸ãã¦define-record-typeã®å¾ã«ç½®ããããªâ¦
æ¥ãçµã£ã¦ããã®ã§ããè¦ãï¼ ãµã¤ãããMac OSåãã£ã½ãã®ããã¦ã³ãã¼ã å±éãã¦/Applications/ã«ã¶ã¡è¾¼ã "/Applications/Racket v5.0.2/bin"ã«PATHãéã ããã§plt-r6rsã§R6RSãåãï¼ãã ï¼ããã ã¨"/Applications/Racket v5.0.2/man"ã¨ãã¬ã³ç¡è¦â¦
Haskellã®scanlã«ç¸å½ãããã®ããªãã£ãã®ã§æ¸ããï¼ (ä¿®æ£ 9:24) (use gauche.collection) (define (scan-with-iterator+builder f seed end? next add! get) (let loop ((seed seed)) (add! seed) (if (end?) (get) (loop (f (next) seed))))) (define-meâ¦