2 ms·
> The canonical "Hello World" program in Dylan. // File library.dylan: Module: dylan-user define library hello use dylan; use io, import: {
by mdaniel 2y ago
> The canonical "Hello World" program in Dylan.
// File library.dylan:
Module: dylan-user
define library hello
use dylan;
use io, import: { format-out };
end;
define module hello
use dylan;
use format-out;
end;
// File hello.dylan:
Module: hello
format-out("Hello!\n");
Give me a break, that is the most insane hello world I have very seen in my life, and I've seen brainfuck. The idea that one must also `use dylan;` in every file in a language named dylan is just stupid, going the extra mile to appear to the untrained eye to be an unused import since the next line is the import that actually matters
- v9v 2y agoI'm assuming that the "use dylan" is there for similar reasons as to why you declare that a package uses :cl in common lisp: This way if you want to define your own functions that replace those in the language (eg. a custom + function) then you can simply omit importing the dylan namespace and define those without worry of conflicts.