Skip to content

Commit

Permalink
Marketing called
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Se committed Nov 30, 2023
1 parent ee9fa49 commit c4d2c80
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
14 changes: 7 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Package: ask
Version: 0.0.2
Title: Condition and Type Query Operator
Description: Combine ? and ~ for simple conditional evaluation, type checks,
type conversions and documentation shortcuts. Optimize thought-to-code
and communicative efficiency by using abbreviations and terse syntax.
Title: Ternary Question Operator
Description: Combine if-then-not ('?', '~', '!') to unify 'if', 'ifelse', 'is',
'as', 'stopifnot' and documentation search. Elegant, terse, yet fast,
the ternary question optimizes thought-to-code and code-to-thought, and
embraces the chain of questions and answers for unprecedented ease-of-use.
Description: Write readable
License: MIT + file LICENSE
Imports: utils
Suggests: tinytest
Encoding: UTF-8
Authors@R: c(
person("Donald", "Seinen",, "donaldseinen@proton.me", c("aut", "cre", "cph"))
)
Authors@R: c(person("Donald", "Seinen",, "donaldseinen@proton.me", c("aut", "cre", "cph")))
BugReports: https://github.com/D-Se/ask/issues
RoxygenNote: 7.2.3
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ remotes::install_github("D-Se/ask")
## Usage

```r
# ternary vectorized query operator with elevated precedence
# ternary vectorized question with elevated precedence
z <- TRUE ? 1 ~ 2

x <- c(TRUE, FALSE, NA)
a <- 1:3; b <- 4:6; c <- 7:9
x ? a ~ {!x ? b ~ c}
x ? a ~ (!x ? b ~ c)

# check types using 3-letter abbreviations
# check types using abbreviations
5 ? num
5 ?! num

Expand All @@ -42,6 +41,9 @@ FALSE ?~ 2
TRUE ?~! "message"
FALSE ?~! "message"

# chain questions from left to right
y <- ("1"?num ?~ "2"?chr ? 10 ~ 20)

# search documentation like usual, except S4 methods
?integer
??regression
Expand All @@ -50,7 +52,7 @@ FALSE ?~! "message"
## Gotchas

```r
# all queries must be of the same type
# all questions must be of the same type
x ? a ~ c(5, 6, 7) # integer is not the same as numeric
x ? a ~ !x ? b ~ c # missing braces, precedence issue
```

0 comments on commit c4d2c80

Please sign in to comment.