English 中文(简体)
7.toBinayString不从事微粒体的工作,而是使用阀=7 。
原标题:7.toBinayString does not work in scala REPL, but with val k=7 it works [closed]
scala> val s = 7.toBinayString 
<console>:7: error: value toBinayString is not a member of Int
       val s = 7.toBinayString 
                 ^

scala> val k = 7
k: Int = 7
scala> k.toBinaryString 
res44: String = 111

由于阀K=7和7被确定为英特,而不是RichInt或java.lang。 我看不出为什么他们得到不同处理。

为什么会有差异?

最佳回答

由于拼错。

toBinayString -> toBinaryString 

“entergraph

问题回答

暂无回答




相关问题
Is there assembler REPL under linux?

Recently I ve started plaing with assembler under linux, there s good debuger, but comming from Ruby I m missing simple REPL that would let me enter a line of assembler code and see the result on ...

C# REPL tools; quick console-like compiling tool

Often times, I start a new instance of Visual Studio, just to create a console application that has some output and/or input. It s a temporary sandbox I use to test a method or something else and ...

How to play with Specs matchers in Scala REPL?

While debugging or exploring spec features it would be more advantageous to type them in REPL (Scala interpreter) rather then in file with spec and run it with something like maven. What is the ...

octave: load many functions from single file

How can I put multiple functions in one file and later get access to all of them in the octave interpreter ? I don t want to have a thousand files and want to group functions together. I d like ...

Clojure emacs slime + swank directory question

I m using emacs with clojure-swank and slime and trying to set my development environment. And I ran into a problem. When I start a repl I m stuck in an unknown directory preventing me to load my ...

scala: tracing implicits selection and other code magics

When trying to figure how a library works, implicit conversions are confusing. For example, looking at an expression like val foo: Foo = 1 , what converts 1 to Foo? Is it possible to instruct the ...

热门标签