Drkcore

08 07 2009 lisp OCaml Tweet

OCamlとlambda

後者は構文糖衣?

# let f = fun x -> x * x
val f : int -> int = <fun>
# let g x = x * x;;
val g : int -> int = <fun>

ここまでやれる

# ( * ) 4 4;;

Common Lispだとこうかな

(setq f (lambda (x) (* x x)))
(funcall f 4)

(defun g (x) (* x x))
(g 4)

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021