alamb commented on code in PR #10700: URL: https://github.com/apache/datafusion/pull/10700#discussion_r1624896673
########## datafusion/functions/src/macros.rs: ########## @@ -36,25 +36,31 @@ /// ] /// } /// ``` +/// +/// Exported functions accept: +/// - `Vec<Expr>` argument (single argument followed by a comma) +/// - Variable number of `Expr` arguments (zero or more arguments, must be without commas) macro_rules! export_functions { - ($(($FUNC:ident, $($arg:ident)*, $DOC:expr)),*) => { - pub mod expr_fn { - $( - #[doc = $DOC] - /// Return $name(arg) - pub fn $FUNC($($arg: datafusion_expr::Expr),*) -> datafusion_expr::Expr { - super::$FUNC().call(vec![$($arg),*],) - } - )* + ($(($FUNC:ident, $DOC:expr, $($arg:tt)*)),*) => { + $( + // switch to single-function cases below + export_functions!(single $FUNC, $DOC, $($arg)*); + )* + }; + + // single vector argument (a single argument followed by a comma) Review Comment: that is pretty fancy 👍 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org