0

I'm using Emacs to write a simple function in sml of about 4 lines and when I try to call the function/evaluate it in the buffer it returns this with 3 dots at the end

val it = [1,2,2,2,2,2,2,2,2,2,2,2,...] : int list

What's the dots at the end? My code doesn't print any dots. Is this is from Emacs or sml? any hints please.

Also I'm supposed to get a longer list like

[1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]

is that why the dots there?

sshine
  • 15,635
  • 1
  • 41
  • 66
Square-root
  • 853
  • 1
  • 12
  • 25
  • 1
    You are seeing the default print length of whatever version of SML you are using (Emacs is just an editor -- what compiler are you using?). You can change the print length (see this: http://stackoverflow.com/a/5079394/4996248 , at least for SML/NJ) or you can write your own list-printing function. The REPL is just for development/ debugging. It typically gives you a peak at the values -- not the full values themselves (which can be quite big). – John Coleman Jan 06 '17 at 02:14
  • V110.75 okay I read the ones above but it's not clear where to put the commands like Control.Print.printDepth:=60; where do I enter this in emacs? – Square-root Jan 06 '17 at 02:21
  • 1
    So you are using SML/NJ. I haven't used Emacs with SML. If there is an interactive mode -- just type it at the prompt. If you are loading files -- just put that towards the top of the file. Experiment. `Control.Print.printDepth:=60;` is just an expression -- evaluate it the same way you evaluated whatever triggered `val it = [1,2,2,2,2,2,2,2,2,2,2,2,...]` – John Coleman Jan 06 '17 at 02:28
  • Great thank you! I used Control.Print.printLength := 1024; in the buffer of emacs (where I evaluate my functions) and it works now :) – Square-root Jan 06 '17 at 03:50

1 Answers1

1

is that why the dots there?

Yes.

sshine
  • 15,635
  • 1
  • 41
  • 66