![]() |
1
11
克里斯托弗·巴茨和布拉德·吉尔伯特的答案是正确的。然而,我想指出一些事情,这些事情可能会使我们更容易理解Python和Perl6之间的等效性。 第一 this page about going from Python to Perl6 到处都是,包括 this section on classes and objects 。
请注意,等效于
另一方面
there are many different ways of overriding that default behavior
,定义自己的
最后,你有
|
![]() |
2
10
在Perl 6中,有默认值
提供以下输出:
我建议您查看 Class and Object tutorial 和上的页面 Object Orientation (后一页包括 Object Construction section HÃ¥kon HÃalgland在对您的问题的评论中提到)。 |
![]() |
3
9
要学究式,最接近的语法等价物是创建
这是最接近的翻译:
这有点惯用
为了真正地道,我会写克里斯托弗所做的。 |
![]() |
July · 如何定义数字间隔,然后四舍五入 1 年前 |
![]() |
user026 · 如何根据特定窗口的平均值(行数)创建新列? 1 年前 |
|
Ashok Shrestha · 需要追踪特定的颜色线并获取坐标 1 年前 |
![]() |
Nicote Ool · 在FastApi和Vue3中获得422 1 年前 |
|
Abdulaziz · 如何对集合内的列表进行排序[重复] 1 年前 |
![]() |
asmgx · 为什么合并数据帧不能按照python中的预期方式工作 1 年前 |