Skip to content

yottadb.require where argument has multiple specifications #39

Answered by berwynhoyt
AlainDsc asked this question in Q&A
Discussion options

You must be logged in to vote

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
  • The linux standard line ending is just a single "\n" not "\r\n"
  • You don't need to end your quote and concatenate another one just to specify the line ending. So you can include your \n at the end of the text and don't need the extra .. as follows:
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 \n that is inherent in the source:

local mexec = ydb.require([[
    mexec: ydb_…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by AlainDsc
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants