Open dram opened 9 years ago
Hello!
This is true in this case, however, not in the more general case of when you need to use something that isn't part of the dylan
library or perhaps having to import additional modules.
I think it would be great to:
The good news is that things are significantly easier to deal with here than they are in Open Dylan.
For more general cases, I wrote a quick and dirty script yesterday:
https://gist.github.com/dram/a91e2911b6a0ec3d9238
It uses the page break character \f
to seperate multple files, quite ugly, but it do works.
Waiting for more elegant solutions. :)
Just figure out that Mindy support using library and module before being defined, as described in http://project-mindy.github.io/mindy/mindy.html#using-libraries-and-modules.
Then a single file Dylan script using library is possible, like this one:
#!/usr/bin/env mindyexec
library: hello-world
module: hello-world
define library hello-world
use dylan;
use format-out;
end;
define module hello-world
use dylan;
use extensions;
use format-out;
end;
define method main (name, #rest ignore)
format-out("Hello, world.\n");
end;
This should work a lot better now, right? (although docs and other things need to be improved)
Yes, nice work!
Now I'm waiting for system
library to be migrated, some modules in it is essential for scripting. Also a nice interface to run external program is needed, system
, piped-exec
even Open Dylan's run-application
is not power enough.
What improvements would you like to see in run-application
?
Some random thoughts relate to run-application
:
piped-exec
)P.S. I think Python's subprocess module is well designed, also see Dart's Process class, and ASDF's run-program.
This statement in Mindy document seems to be not true.
hello-world
example can be simplified to use only one file, as:This file can run by following command:
Combine with
mindyexec
, writing Dylan script using Mindy is possible: