dgkf / dgkf/R

Deviations from the R langauge

Open
#6 7 comments 0 reactions 0 assignees View on GitHub
type-design
Dominant language
Rust
Stars
145
Forks
5
PR merge metrics
No merged PRs in 30d

Description

An ongoing catalog of intentional deviations from `R`, in varying stages of maturity

### Confident

- [x] Lowercase equivalents for all uppercase keywords (`NULL`, `TRUE`, `FALSE`, `Inf`, `NA`)
- [x] `fn` as an alias for `function` (and replaces `R` lambda `\()` syntax)
- [x] Allow trailing commas in all function calls (eg `list(a = 1,)`)

### Undecided

- [ ] `[` as a primitive for creating a vector (ie, `[1, 2, 3]`)
- [ ] `(` as a primitive for creating a list (ie `(1, 2, 3)` or `(a = 1, b = 2, c = 3)`)
- [ ] Introduce scalar values
- [ ] Remove `[[` as an indexing operator.
With the above, indexing with a scalar value could return an element (`x[1]`), while indexing with a vector could return a vector (`x[ [1, 2] ]`; spaces to emphasize that this also uses the `[` operator by passing a vector, `[1, 2]` - not a separate `[[` operator). This is more similar to `python`'s `pandas` indexing, but doesn't play nicely without scalar values in the first place (otherwise `1` is equivalent to `c(1)` an we always index by vector anyways).

### Needs Feedback

- [ ] A language construct for flagging when non-standard evaluation is enabled. This should exist at function declaration. Undecided on whether it should apply to a whole function or specific arguments.
- [ ] A type system (some early exploration in an R-native implementation in [dgkf/typewriter](https://github.com/dgkf/typewriter))

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.