develooper Front page | perl.perl5.porters | Postings from July 2020

Syntax syntax

Thread Next
From:
Matt S Trout
Date:
July 4, 2020 12:49
Subject:
Syntax syntax
Message ID:
20200704120513.GD20268@vps-6c71e929.vps.ovh.net
An alternative idea to the 'vX' approach - some years ago, we coined syntax.pm
with the intent of that being usable to do "either use an XS module or a core
feature depending on whether there was a core feature for $whatever yet" - so
repurposing that namespace seems entirely fine.

What that would look like is:

  use syntax v5;
  use syntax v7;
  use syntax v8-preview;

Note that all three of these parse as-is so it should be possible to make
syntax.pm dual-life and thereby allow support for that on older perls where
a too-new version would simply throw an error.

This would also make it feasible to provide Todd's desire of

  use syntax -latest;

to provide the latest stable syntax set, and possibly also

  use syntax -blead;

or similar to opt in to the current syntax preview (whether that one's a good
idea or not is left as an exercise to the audience).

I think this might be easier for packagers trying to keep things sensible
across multiple versions, and would leave 'use v8;' able to mean "a perl
interpreter of at least version 8" rather than conflating that and "a perl
interpreter that supports syntax version 8".

Thoughts?

-- 
Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue

http://shadowcat.co.uk/blog/matt-s-trout/   http://twitter.com/shadowcat_mst/

Email me now on mst (at) shadowcat.co.uk and let's chat about how our CPAN
commercial support, training and consultancy packages could help your team.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About