0

I am very new to SML-NJ. I am writing a code to add the values of Number1 and Number2 in SML-NJ. I want to use the GRAAL like data type definition in my code.

Part - A :

type Variable=string
type Integer_constant=int

I want to do something like following.

val number = Variable

Part - B : I know that if I have used the datatype as Variable then it is going to work, Working case as below,

datatype Variable=str of string
type Integer_constant=int
val number = str("number");

Now, I have to do the same thing in a Part - A which is present in Part-B. Indirectly, I have to used type as a data definition for the Variable.

ymonad
  • 11,710
  • 1
  • 38
  • 49
  • Your question isn't very clear. I have read it several times and still don't know what you are asking. Perhaps by `val number = Variable` you are trying to do something like `val number = "42": Variable`? – John Coleman Oct 14 '16 at 02:43
  • Hey John, thanks for your quick response. Yes, I am looking for the same thing which you have mention in your comment. I got my code working. Thanks a lot once again. – Bhushan Ladde Oct 14 '16 at 04:57

0 Answers0