Hi,
I find the Basis Library to be inadequate for many of my use cases. E.g. I'm used to having built-in Set and Map/Dict abstract datatypes (ADTs); and built-in sort function for all the common ADTs. Then, I realise I can start poly by loading all the code with "--use FILE" from command line.
So, my question is how to suppress "poly --use ROOT.sml" loaded definition message to STDOUT? E.g.
$ poly --use ROOT.sml Poly/ML 5.8.2 Release val testme = "Test me!": string <---- suppress this line val it = (): unit <---- and this line > 1; val it = 1: int <---- while keep printing of results
I have tried "poly --use 'FILE' -q" with the "-q" option. But it turns off printing of results as well (which is undesired). I hope there is an easy way (probably a switch/flag?) to achieve what I want, and avoid writing another REPL.
Thanks!
On 08/12/2021 07:04, zacque wrote:
I find the Basis Library to be inadequate for many of my use cases. E.g. I'm used to having built-in Set and Map/Dict abstract datatypes (ADTs); and built-in sort function for all the common ADTs. Then, I realise I can start poly by loading all the code with "--use FILE" from command line.
So, my question is how to suppress "poly --use ROOT.sml" loaded definition message to STDOUT? E.g.
$ poly --use ROOT.sml Poly/ML 5.8.2 Release val testme = "Test me!": string <---- suppress this line val it = (): unit <---- and this line > 1; val it = 1: int <---- while keep printing of results
I have tried "poly --use 'FILE' -q" with the "-q" option. But it turns off printing of results as well (which is undesired). I hope there is an easy way (probably a switch/flag?) to achieve what I want, and avoid writing another REPL.
Hi zacque,
The -q option turns printing off by setting PolyML.print_depth to zero. You can always turn printing on at any point by calling PolyML.print_depth with a non-zero value.
By the way, have a look at the Poly/ML software directory at https://www.polyml.org/software/index.php . You might find some of these library extensions there and if not and you're happy to make your extensions available please consider adding an entry to the directory.
David
Hi David,
The -q option turns printing off by setting PolyML.print_depth to zero. You can always turn printing on at any point by calling PolyML.print_depth with a non-zero value.
Thank you for your pointer. With a bit of tweaking, it solves my problem using this command:
$ poly --use ROOT.sml -q --eval "print "** Augmented Poly/ML **\n"" \ --eval "PolyML.print_depth 1"
By the way, have a look at the Poly/ML software directory at https://www.polyml.org/software/index.php . You might find some of these library extensions there and if not and you're happy to make your extensions available please consider adding an entry to the directory.
Thanks, sure I'll contribute to the site once I've finished writing my library. Right now, I'm doing this to cure my immediate pain of loading external data structures and algorithms libraries.
Another purpose is to load on startup something like the asdf of Common Lisp, which is used to load other libraries.