加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

Perl 5.20和智能匹配和给定的命运?

发布时间:2020-12-15 21:28:34 所属栏目:大数据 来源:网络整理
导读:我刚安装Perl 5.18,我得到了很多这样的警告, given is experimental at .[...].pl line [...].when is experimental at .[...].pl line [...].Smartmatch is experimental at C:/strawberry/perl/site/lib/[...] line [...]. 看看这些警告 – 我从来没有
我刚安装Perl 5.18,我得到了很多这样的警告,
given is experimental at .[...].pl line [...].
when is experimental at .[...].pl line [...].
Smartmatch is experimental at C:/strawberry/perl/site/lib/[...] line [...].

看看这些警告 – 我从来没有听说过任何地方 – 我只能在两个地方找到这个,

> perldelta for 5.18,只有真正提到,说,该功能已降级为实验?
> this nntp.perl.org post

Perl Delta仍然做的最多,提到这些功能发生了什么,它的一半埋在pod,

Smart match,added in v5.10.0 and significantly revised in v5.10.1,has been a regular point of complaint. Although there are a number of ways in which it is useful,it has also proven problematic and confusing for both users and implementors of Perl. There have been a number of proposals on how to best address the problem. It is clear that smartmatch is almost certainly either going to change or go away in the future. Relying on its current behavior is not recommended. Warnings will now be issued when the parser sees ~~,given,or when.

我对如何在过去10年中Perl最重要的变化可能被拉扯困惑。我开始使用给定,时间和smartmatch在所有的地方。有关这些期货的更多信息吗?任何人发现他们“困惑?这些功能如何可能改变?有计划用模块实现这些功能吗?

解决方法

智能匹配的设计存在问题。任何给定的TYPE?TYPE应该做什么的决定最常见的是不明显,不一致和/或有争议。这个想法不是删除智能匹配;它是修复它。

具体来说,~~将会大大简化,你可以看到在一个proposal由5.18 pumpking。关于如何两个事情应该匹配的决定将与帮助者,如那些已经存在于Smart::Match。

... ~~ any(...)

更可读,更灵活(完全可扩展),并解决了许多问题(例如“何时应将X视为数字,何时应视为字符串?”)。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读