Skip to content

Conversation

@jbarrett
Copy link
Contributor

@jbarrett jbarrett commented Mar 23, 2025

This is not yet working - the enum constructor expects the occasional aligning value, then a list of strings which it increments the value for. I tried coercing all the values to arrayrefs with pair, but the constructor is so-far unhappy with this.

It should at least show off how this should work. The parameter to your FFI bound function should now be a string, e.g. 'KEY_A', and functions can also be coerced into returning string constants - see return type for GetKeyPressed.

It's not a radical departure API-wise - rlt-01.pl should reflect the required changes from the end-user POV.

edit The main advantage of this is that you don't have to worry about importing constants into your namespace.

perigrin and others added 7 commits March 2, 2025 17:44
- use Feature::Compat for Class and Try
- move to Exporter from export_lexically
This is not yet working - the enum constructor expects the occasional
aligning value, then a list of strings which it increments the value
for. I tried coercing all the values to arrayrefs with pair, but the
constructor is unhappy with this.

It should at least show off how this *should* work. The parameter to
your FFI bound function should now be a string, e.g. 'KEY_A', and
functions can also be coerced into returning string constants - see
return type for `GetKeyPressed`.

It's not a radical departure API-wise - rlt-01.pl should reflect the
required changes
@perigrin perigrin marked this pull request as draft May 8, 2025 03:13
@perigrin
Copy link
Member

perigrin commented May 8, 2025

I've converted this to a draft so I don't forget that it's not ready to go in yet. I'll have a look sometime between now and TPRC and see what I can do with it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants