perl6-http-client icon indicating copy to clipboard operation
perl6-http-client copied to clipboard

Consider a more Perl 6'ish API?

Open smls opened this issue 9 years ago • 1 comments

Did you consider letting the API exploit some of the shiny elegant Perl 6 features like assignable (rw) accessors and overloadable subscript operators?

This seems so Perl 5'ish to me:

$request.url('http://example.com/web/service');
$request.add-field(id => 37271);

Whereas Perl 6 allows the following, which would be a much more elegant I think:

$request.url = 'http://example.com/web/service';
$request.fields<id> = 37271;

smls avatar Jun 07 '15 10:06 smls

That would be a great idea. This was written several years ago when not all the features that are available now were available yet. Most of my libraries could probably use some major refactoring, if not complete rewrites given the number of changes since I worked on them last. I'm not very active on here anymore, as my day job keeps me rather occupied.

supernovus avatar Jun 07 '15 20:06 supernovus