yottadb.require where argument has multiple specifications #39
-
Dear, I wanted to use the function However, my specification have 2 lines. Following code seems to work:
My question is : is this working by accident , or is this the right way to do so ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Yes, that's a valid way to do it. However, a few stylistic notes:
local mexec = ydb.require(
"mexec: ydb_string_t*[1024] %X^%yadlua(I:ydb_string_t*)\n" ..
"mexecp: ydb_string_t*[1024] %X^%yadlua(I:ydb_string_t*, I:ydb_string_t*)" ) or, using Lua long literals you can even do the following, which captures the local mexec = ydb.require([[
mexec: ydb_string_t*[1024] %X^%yadlua(I:ydb_string_t*)
mexecp: ydb_string_t*[1024] %X^%yadlua(I:ydb_string_t*, I:ydb_string_t*)
]] |
Beta Was this translation helpful? Give feedback.
-
Thank you, Berwyn, this is definitely an answer to my question. |
Beta Was this translation helpful? Give feedback.
Yes, that's a valid way to do it. However, a few stylistic notes:
"\013\10"
is more commonly known as"\r\n"
in Lua"\n"
not"\r\n"
\n
at the end of the text and don't need the extra..
as follows:or, using Lua long literals you can even do the following, which captures the
\n
that is inherent in the source: