Skip to content

Commit

Permalink
Address pbackus’ review
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Backus <snarwin@gmail.com>
  • Loading branch information
0xEAB and pbackus authored Feb 3, 2025
1 parent 2631a8b commit 4e21561
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions std/functional.d
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ $(TR $(TH Function Name) $(TH Description)
$(TD Passes the fields of a struct as arguments to a function.
))
$(TR $(TD $(LREF ctEval))
$(TD Enforces the execution of a function during compile-time.
$(TD Enforces the evaluation of an expression during compile-time.
))
))
Expand Down Expand Up @@ -2172,20 +2172,20 @@ template bind(alias fun)
}

/**
* Enforces the execution of a function during compile-time.
* Enforces the evaluation of an expression during compile-time.
*
* Computes the return value of a function call during compilation (CTFE).
* Computes the value of an expression during compilation (CTFE).
*
* This is useful for call chains in functional programming
* where no explicit `enum` can be placed inline and would require splitting
* where declaring an `enum` constant would require splitting
* the pipeline.
*
* Params:
* fun = callable to evaluate
* expr = expression to evaluate
* See_also:
* $(LINK https://dlang.org/spec/function.html#interpretation)
*/
enum ctEval(alias fun) = fun;
enum ctEval(alias expr) = expr;

///
@safe unittest
Expand Down

0 comments on commit 4e21561

Please sign in to comment.