使用Vim进行Lisp开发(Using Vim for Lisp development)
我一直在使用Lisp一段时间,但是我开始更加认真地在Lisp中做一些“真正的”工作。 我是一个巨大的Vim粉丝,并且想知道如何使用Vim作为Lisp开发的编辑器最有效率。 插件,工作流程建议等都欢迎。
请不要说“使用emacs”,因为我已经加入了Vim,我真的很喜欢它作为编辑。
I've been using Lisp on and off for a while but I'm starting to get more serious about doing some "real" work in Lisp. I'm a huge Vim fan and was wondering how I can be most productive using Vim as my editor for Lisp development. Plugins, work flow suggestions, etc. are all welcome.
Please don't say "use emacs" as I've already ramped up on Vim and I'm really enjoying it as an editor.
原文:https://stackoverflow.com/questions/94792
最满意答案
你不能,真的 Java除了
char
之外没有任何未签名的数据类型。诚然,你可以使用
char
- 它是一个16位无符号类型 - 但是在我看来,这可能是可怕的,因为char
显然是为了文本:当代码使用char
,我希望它使用它来进行UTF-16代码表示程序有趣的文本的单位,而不是与文本无关的任意无符号16位整数。You can't, really. Java doesn't have any unsigned data types, except
char
.Admittedly you could use
char
- it's a 16-bit unsigned type - but that would be horrible in my view, aschar
is clearly meant to be for text: when code useschar
, I expect it to be using it for UTF-16 code units representing text that's interesting to the program, not arbitrary unsigned 16-bit integers with no relationship to text.
相关问答
更多-
在Java中转换为短字节[](Convert short to byte[] in Java)[2023-07-17]
ret[0] = (byte)(x & 0xff); ret[1] = (byte)((x >> 8) & 0xff); ret[0] = (byte)(x & 0xff); ret[1] = (byte)((x >> 8) & 0xff); -
java中没有符号短(unsigned short in java)[2023-07-10]
你不能,真的 Java除了char之外没有任何未签名的数据类型。 诚然,你可以使用char - 它是一个16位无符号类型 - 但是在我看来,这可能是可怕的,因为char显然是为了文本:当代码使用char ,我希望它使用它来进行UTF-16代码表示程序有趣的文本的单位,而不是与文本无关的任意无符号16位整数。 You can't, really. Java doesn't have any unsigned data types, except char. Admittedly you could use c ... -
在C中, int至少意味着拥有CPU的“自然”字大小, long可能意在成为“较大的自然”字大小(在最后一部分不确定),但这也将解释为什么int和long在x86上有相同的大小)。 现在,我的猜测是:对于int和long ,有一个自然的表示符合机器的寄存器。 然而,在大多数CPU上,使用较小的byte和short类型,不得不将其填充到int 。 如果是这样,你也可以有一个演员。 In C, int at least was meant to have the "natural" word size of t ...
-
设置短值Java(Setting Short Value Java)[2022-02-27]
在Java中,整数文字的类型为int,除非它们带有字母“L”或“l”(资本L优选为小写L,难以与数字1区分开)。 如果后缀为L,则文字类型为long。 后缀在Java语言规范中没有任何特殊的名称。 任何其他整数类型都没有后缀。 所以如果你需要短或字节字面值,它们必须被转换: byte foo = (byte)0; short bar = (short)0; 在setLongValue(100L)中,您不一定必须包含L后缀,因为在这种情况下,int文字会自动加宽到很长。 这在Java语言规范中称为扩展原语转 ... -
您还可以从Java DataInputStream借用一个页面。 readUnsignedShort ()实现: public final int readUnsignedShort() throws IOException { int ch1 = in.read(); int ch2 = in.read(); if ((ch1 | ch2) < 0) throw new EOFException(); return (ch1 << 8) + (ch2 << ...
-
这里最重要的是基元在时间和内存复杂性方面比对象包装器便宜。 如果必须在必须使用Object引用的上下文中使用这些原语(即必须将它们包装/“装箱”到它们的对象包装器中,Google自动装箱),则池功能才变得相关。 如果你可以一直使用它们作为原始数字那么它是最有效的方式。 细节: Java语言将原语类型(boolean,byte,char,short,int,long,float,double)与所有其他类型(引用类型)区别对待。 基元可以直接存在于堆栈中,并且可以由JVM指令直接操作(每个基元都有一组指令)。 ...
-
将C#代码迁移到Java,无符号短字节和字节数组转换(Migrating C# code to Java, unsigned short and byte array conversion)[2023-09-02]
要么我不理解您尝试进行的转换背后的原因,要么错误地构思它们,这意味着我无法判断它们的实现是否存在错误。 java中的类型byte与C#中的sbyte类型完全相同,因此您可以使用sbyte在C#中进行所有测试,并确保在移植到java之前正常工作。 (byte)0xaa = 170 (sbyte)0xaa = -86 (byte)0xbb = 187 (sbyte)0xbb = -69 因此,在Java中,您的字节数组应为{-86,-69}。 Either I do not understand the re ... -
java中的短条件(Short condition in java)[2023-08-25]
如果您的方法如下所示: public boolean foo() { String a = "a", b = "b", c = "c", d = "d"; if(a == null || b == null || c == null || d == null) { return false; } return true; } 然后有一种方法可以减少代码。 你可以这样做: public boolean foo() { String a = "a", ... -
实际上,可以在提取之前将Mat转换为带符号的字节: mat.convertTo(mat, CvType.CV_8S); It's actually possible to convert the Mat to signed byte before extracting it: mat.convertTo(mat, CvType.CV_8S);
-
Java中“short s = 1”和“(short)1”之间有什么区别?(What's the difference between 'short s = 1' and '(short) 1' in Java?)[2023-11-07]
默认情况下,1将在Java中视为int。 所以,当你做((短)1)时,你通过函数传递1作为一个短参数。 接收参数应该是短类型。 然而,当你有短s = 1时,那么它显然是一个short整数。 请记住,在这两种情况下,执行操作时short将转换为int( 这称为类型提升 )。 并且,如果使用双操作数操作,那些int将被提升为double。 它们之间有什么区别,哪个更好? 两者最终都做了相同的操作(传递一个短变量作为参数),并且它们都同样更好。 但是,你应该防止使用short整数,除非极其必要,因为它有一些缺点( ...