Open brynne8 opened 4 years ago
Hi @AlexanderMisel , function with different types of args are supported, see:
https://github.com/LingDong-/wenyan-lang/issues/280#issuecomment-567987049
Sorry ./documentation/syntax.txt
is a work in progress and might be inaccurate. @jiangzoi , Please fix :)
Anonymous functions are not here yet, but I agree it will be very handy and will be probably implemented along with other functional programming goodies.
Thank you for bringing this up!
Will anonymous function be supported by wenyan-lang? Currently it seems we always need to have a name, and start functions with
吾有 int_num 術 reference_single_statement 欲行是術
, which is not very flexible. For example. we want to express object likeBut according to the syntax, object properties are made up of either
value
oridentifier
. So we may have to define it before we assign it to a property.As
function_arg
is defined aswe might be unable to define a function with different types of args, for example
Moreover, we might need to use variable number of args in some cases, and most languages support that, for example,