1 | # These were helpful while implementing args.ysh
|
2 | # Maybe we will want to export them in a prelude so that others can use them too?
|
3 | #
|
4 | # Prior art: Rust has `todo!()` which is quite nice. Other languages allow
|
5 | # users to `raise NotImplmentedError()`.
|
6 |
|
7 | # Andy comments:
|
8 | # - 'pass' can be : or true in shell. It's a little obscure / confusing, but
|
9 | # there is an argument for minimalism. Although I prefer words like 'true',
|
10 | # and that already means something.
|
11 | # - UPDATE: we once took 'pass' as a keyword, but users complained because
|
12 | # there is a command 'pass'. So we probably can't have this by default.
|
13 | # Need to discuss source --builtin.
|
14 |
|
15 | # - todo could be more static? Rust presumably does it at compile time
|
16 |
|
17 | proc todo () {
|
18 | ## Raises a not implemented error when run.
|
19 | error ("TODO: not implemented") # TODO: is error code 1 ok?
|
20 | }
|
21 |
|
22 | proc pass () {
|
23 | ## Use when you want to temporarily leave a block empty.
|
24 | _ null
|
25 | }
|