Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set nop as default in device.new() #180

Open
sav opened this issue Sep 3, 2024 · 1 comment
Open

set nop as default in device.new() #180

sav opened this issue Sep 3, 2024 · 1 comment

Comments

@sav
Copy link
Collaborator

sav commented Sep 3, 2024

currently, it's a common practice to initialize the device as: device.new(name="foo", open=nop, release=nop), where nop=function () end. we could assume it as the default, when no argument is provided.

@lneto
Copy link
Contributor

lneto commented Sep 4, 2024

Perhaps the best approach is to have a higher-level API in Lua to avoid doing much in C; similarly to socket.inet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants