[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Proposal: package.(c)path as tables
- From: Martin <eden_martin_fuhrspam@...>
- Date: Thu, 7 Sep 2017 09:29:26 +0100
I see two arguments in this thread versus proposal:
* "operating systems do it that way"
* string parsing is easy
Regarding first. Even if operating system stores search paths as
string, should Lua language export this behavior?
Second. Yes, string parsing is strong side of Lua. Should it
be considered the natural way to communicate?
For example why not add some magic char "results separator" "@" so
that "return 1, 2" will return string "1@2". Yes, it may be parsed
to table in two lines (two _correct_ lines).
I'd wish that language standard libraries use more Lua.
Ideally, to add path "../strange;name/*.lua" I'd wish to call
package.add_search_path('../strange;name/*.lua')
and do not know about special characters from "package.config"
for name substitution and records delimiting.
Current proposal (store "package.path" as sequence of strings)
releases user from knowing about paths delimiter character.
So it simplifies code, making it more understandable for "common
programmer".
-- Martin