I want smlnj to return a list in its cons form when I input a list in the regular list notation. Is there a way to get smlnj to do this for me?
Here is an example:
input: [1,2,3]
output: 1::2::3::[]
I want to use this to understand how more complicated int list lists are stored internally through some examples.
You can get pretty close by creating your own list type. Here we write
emptyinstead of[], and:::instead of::, but otherwise it's identical to normal lists.SML/NJ will show values of this type without any syntax sugar.