echo

{- Haskell -}
import System

main = do args <- getArgs
          putStrLn $ unwords args
  • モジュール
    • すべての関数や変数はモジュールに所属する
    • import宣言でインポートする
    • Main module
      • main変数を含むモジュール
      • デフォルトでは、外部にmain変数だけを公開
    • Prelude module
      • 暗黙のうちにインポートされる

: System.getArgs , unwords ss

(* OCaml *)
open Sys

let rec echo i =
  if i < (Array.length argv)
  then begin print_string (argv.(i) ^ " ") ; echo (i + 1) end
  else print_string "\n"

let _ = echo 1