amber-lang / amber-lang/amber

[Feature] extra options for builtins and stdlib functions

Aperta
#987 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
compiler pr/stalled stdlib syntax
Lingua principale
Rust
Stelle
5.2k
Fork
145
Merge medio
5g 3h
PR unite (30g)
7

Descrizione

**Is your feature request related to a problem? Please describe.**
current and future builtins and stdlib functions are and will lack ability to use custom options provided by the commands, and this limits usage of such builtins, since you can't add/enable specific option you'd usually add when using command directly

**Describe the solution you'd like**
command options structure:
```
mv("file.ab", "newdir", {
verbose: true,
force: true
})
// would generate:
// mv "file.ab" -T "newdir" --force --verbose

mv("file.ab", "newdir", {
backup: "backupfile.ab",
f: true
})
// would generate:
// mv "file.ab" -T "newdir" -f --backup="backupfile.ab"
```

**Describe alternatives you've considered**
```
mv("file.ab", "newdir", backup: "backupfile.ab", f)```
// mv "file.ab" -T "newdir" --backup="backupfile.ab" -f

mv("file.ab", "newdir", "--backup=backupfile.ab", "-f")```
// mv "file.ab" -T "newdir" --backup="backupfile.ab" -f
```
**Additional context**
this is just for the future, when we will get structures and enums to properly parse extra options, but builtins could theoretically parse this on compiler side

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.