Closed python128 closed 2 years ago
These symbols would be great to have. Unfortunately the evaluator doesn't understand them yet though, so they'll need to be added to kalk::lexer
(in kalk/src
) as well. For example, '*' => build(TokenKind::Star, "", span),
would be '*' | '×' => build(TokenKind::Star, "", span),
. Function aliases like the cbrt one are added in the next_identifier
function (like with the sigmas there I believe). Then they all also need to be added to the is_valid_identifier
function to make sure they're not parsed as variables. As for the powers... Hmm... They may be a bit more complicated.
Currently there are no functions with variadic parameters, but it may be possible without changing too much. Functions for kalker generally go in kalk::prelude::mod
, but some special ones may be located directly in kalk::interpreter::eval_fn_call_expr
. It could probably be placed here for now, and then I could see about making prelude functions a bit more flexible later on.
Also fixed a code block (
rustfmt
) in ContributingI would also like to make an Average function to be used as such:
Where should I place the code for the above?