Embedded.Value Argument Evaluation RRS feed

  • Question

  • Hello,

    Is there some special behavior in play with how Embedded.Value’s arguments are evaluated?

    If I define a function that expects two non-optional arguments (like: '(arg1 as any, arg2 as any) => …'), M requires that I provide values for both arguments when I call the function. If I don’t, it complains with an Expression.Error: “1 arguments were passed to a function which expects 2.” This aligns with the language specification: “A required parameter indicates that an argument corresponding to the parameter must always be specified when a function is invoked.”

    However, while Embedded.Value is defined as requiring two arguments ('(value as any, path as text)'), M makes no complaints if I only provide one (e.g. 'Embedded.Value("5ee9ae84-dacc-41f1-9b1b-9b877b864e77")').

    What’s going on here? 😊 Why doesn’t M force the second argument to be provided?

    Thank you,

    Wednesday, May 6, 2020 9:00 PM


All replies