2

I am trying MetaOCaml, so I have made this fantastic code :

#let a = .<1>.;;
val a : int code = .<1>. 
# let b = !. a;;
Error: Unbound value !.
# let b = .!a;;
Error: Syntax error

Why doesn't it work ?

Also, I have tried !. and .! because I have seen both on websites but don't know which one is the right one.

objmagic
  • 1,028
  • 1
  • 9
  • 18

1 Answers1

5

I figured it out from http://okmij.org/ftp/ML/MetaOCaml.html

Runcode module needs to be opened to use !. and not .! which is syntaxly incorrect.

A correct execution would be :

#let a = .<1>.;;
val a : int code = .<1>. 
#open Runcode;;
#!.a;;
- : int = 1
Community
  • 1
  • 1