语法 问答列表

为什么这个变量不在范围之内?(哈斯克尔)

作者:user8930358 提问时间:11/13/2017

我会直接开始(我删除了一堆无关的代码,以防这看起来有点有趣 - 试图让它成为 MCVE): import System.IO import Control.Monad import Data.IOR...

在 Haskell 中将任何类型的列表作为函数参数(使用 Replit)

作者:Sophie 提问时间:4/19/2023

我正在尝试在 Haskell 中编写一个函数,该函数将列表作为参数并返回并删除最后一个元素 这是我拥有的代码: remLastElement :: [a] -> [a] remLastElement...

下标序列时,Python 中的 :: (双冒号)是什么?

作者:Aillyn 提问时间:8/11/2010

我知道我可以在 Python 中使用类似的东西来获取子字符串,但是 3 在 ?string[3:4]somesequence[::3]...

使用 linq 返回对象特定属性的列表

作者:Maxim Gershkovich 提问时间:7/20/2012

给定这样的类: public class Stock { public Stock() {} public Guid StockID { get; set; } public string D...

为什么这会调用默认构造函数?

作者:fredoverflow 提问时间:7/27/2012

struct X { X() { std::cout << "X()\n"; } X(int) { std::cout << "X(int)\n"; } }; const int answer ...

PHP5 - 赋值操作结果未被解析器视为对象

作者:Bastien 提问时间:2/1/2017

我对解析错误有点困惑: class Foo{ public function some_function(){} } ($foo = new Foo())->some_function(); ...

-&gt; &lt;- 运算符是做什么的?

作者:fredoverflow 提问时间:7/24/2014

我最近遇到了以下代码: IntPredicate neg = x -> x <- x; 这是什么,某种反向双 lambda?...

为什么赋值 int 和 float 不会产生错误,而赋值 while 会生成错误?

作者:Udesh 提问时间:5/17/2022

源: int = 33 float = 0.0 while = 33 输出: while = 33 ^ SyntaxError: invalid syntax 为什么对 int 和 flo...

C++ 中的 a = 5、a(5)、a{5} 和 a[5] 有什么区别?

作者:RobertS supports Monica Cellio 提问时间:1/16/2020

、 和 C++ 中的语句有什么区别?a = 5a(5)a{5}a[5] 我偶尔会看到它们用于任何事情,例如在 C++ 程序中为对象分配值。它们之间的区别在哪里?...

SyntaxError - 无法分配给运算符

作者:Ishan Dwivedi 提问时间:12/4/2021

File "solution.py", line 12 Rate=8.45 and S=75 and D=tempUnit-150 ^ SyntaxError: can't assign to o...


共597条 当前第5页