我对If Then Else的定义中的投影有问题.它实际上是作为If-Else-Then执行的.
import Prelude hiding (pred,and,or,not)
data PR = Z
| S
| P Int
| C PR [PR]
| PR PR PR
deriving Show
eval :: PR -> [Integer] - Integer
eval Z _ = 0
eval S [x] = x+1
eval (P n) xs = nth n xs
eval (C f gs) xs = eval f (map (\g -> eval g xs) gs)
eval (PR g h) (0:xs) = eval g xs
eval (PR g h) (x:xs) …Run Code Online (Sandbox Code Playgroud) 很长一段时间以来,我一直在使用工作来对csproj文件进行差异编辑,编辑等.您是否可以在Visual Studio中更改某些设置以使其可以通过解决方案资源管理器打开文件或启用所有其他文件具有的比较选项?如果是这样,他们是什么/在哪里?
这不是我不可能在Notepad ++中打开它,或者去团队资源管理器以便我可以将它与服务器版本区分开来,但为什么我必须这样做?
运行我在Visual Studio中创建的程序后,显示以下错误.
错误1只有赋值,调用,递增,递减,等待和新对象表达式才能用作语句F:\ CS4\Form1.cs 103 21 CS4
下面是它正在发生此错误的代码集...
catch (FormatException err)
{
MessageBox.Show("Pay Rate must be numeric. " + err.Message,
"Data Entry Error", MessageBoxButtons.OK);
MessageBoxIcon.Exclamation;
txtPayRate.SelectAll ();
txtPayRate.Focus ();
Run Code Online (Sandbox Code Playgroud)
文本MessageBoxIcon.Exclamation; 是我点击错误信息时突出显示的地方
我不知道为什么一直这么说.任何想法如何解决它?
我有一个具有以下定义的函数:
virtual bool Process(wtdaFileHandler &daHandler, wtdaGather &daGather);
这个函数中的所有代码路径都返回一个bool,我肯定在调用这个函数,而不是子类中的函数.以下代码在发布标题中产生错误:
wtdaLFDProcess process;
// call some methods to do initialize process and args.
if (process.Process(daLFDFileHandler, daGather));
{
retval = 0;
}
else
{
retval = LFD_FILE_LOCK_ERROR;
cout << "Could not obtain file lock for processing." << endl;
WTDA_STATUS(3, "Error...Stopping" );
return;
}
Run Code Online (Sandbox Code Playgroud)
有谁能解释一下?也许这是我不知道的C++的一些警告?对我来说完全是无稽之谈.这个错误无疑是指其他的.我已经建立起来确保它不仅仅是智能感知.这是一个Win32 C++项目.
我写了一个我在游乐场看到的问题的例子:https: //play.golang.org/p/rPCqAC56Ff
这很明显,但是我在if语句之外声明一个变量,在if中设置变量然后在if之外使用.
问题很简单,为什么这不起作用?
package main
import (
"fmt"
"os"
)
func main() {
var foo string
if true {
foo = "foo"
} else {
foo, found := os.LookupEnv("GOPATH")
if !found {
fmt.Printf("who cares.\n")
}
}
println(foo)
}
Run Code Online (Sandbox Code Playgroud)