require checks if the file was already executed. do EXPR doesn't.
The makes require the better choice when loading a module (a file with a package directive), and do otherwise (i.e. never).
do also has an unrelated do BLOCK form which is useful for inlining multiple statements into an expression.
In reply to Re: require() vs do()
by ikegami
in thread require() vs do()
by vinoth.ree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |