[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [proposal] require resources
- From: Sean Conner <sean@...>
- Date: Sun, 19 Jan 2020 23:39:39 -0500
It was thus said that the Great Soni They/Them L. once stated:
> > On 2020-01-20 1:10 a.m., Sean Conner wrote:
> > It might seem like a simple request, but it's not.
>
> The same can be said of require.
>
> Again it would just be replacing patterns:
>
> icon = require("org.conman.app.gopherclient","gopher.icon")
>
> replace the left's .'s with /'s, add / at the end, add right at the end.
>
> if you had resource path /usr/lib/lua/5.4/? for example, it would try to
> open /usr/lib/lua/5.4/org/conman/app/gopherclient/gopher.icon
Does it ever occur to you to actually *try* to implement your ideas?
This idea, with a separate resource path, could be done in pure Lua. Add
a package.rpath (for resource path), then replace require() to look for two
parameters and handle it appropriately? I know I made a similar change
(adding a path, adding a new searcher function) to load C functions directly
from source [1]. And then hey, post the code and get feedback.
-spc (Sigh)
[1] https://github.com/spc476/lua-conmanorg/blob/master/lua/cc.lua