跳轉到內容

CDuce/指令

來自華夏公益教科書,開放的書本,開放的世界

CDuce 指令 #help 列出了可用的頂級指令

#help;;
Toplevel directives:
  #quit;;                 quit the interpreter
  #env;;                  dump current environment
  #reinit_ns;;            reinitialize namespace processing
  #help;;                 shows this help message
  #print_type <type>;;
  #silent;;               turn off outputs from the toplevel
  #verbose;;              turn on outputs from the toplevel
  #builtins;;             shows embedded OCaml values

CDuce 指令 #quit 允許退出(例如,退出)頂級直譯器。Ctrl-C 和 Ctrl-D 鍵可以執行相同的操作。

CDuce 指令 #env 列出了已定義的型別等。

#env;;
Types: Namespaces AnyXml String Record Latin1 Empty Arrow Float Pair Char Atom Bool Byte Any Int
...

#print_type

[編輯 | 編輯原始碼]

CDuce 指令 #print_type 顯示 CDuce 型別的表示形式。

#print_type String;;
[ Char* ]
華夏公益教科書