나는 스칼라에서 파이썬에 익숙하지만 멍청한 사람이다. 필자는 스칼라에 더러운 실험 코드를 작성하려고합니다. 스칼라가 파이썬에서 help()
과 같은 함수를 가지고 있다면 정말 편리 할 거라고 생각했습니다. 예를 들어, Scala에 내장 된 메서드를보고 싶다면 Array
help(Array)
과 같은 것을 입력하고 싶습니다. help(list)
을 Python으로 입력하면됩니다. 스칼라에는 그런 것이 있습니까?스칼라와 파이썬 도움말()
답변
마찬가지로 IDEA는 Scala 및 Java (-Doc) JAR 및 소스 코드 문서 주석에 사용할 수있는 "빠른 문서 검색"명령을 가지고 있습니다.
필자는 탭 완성이 파이썬의 도움에 가장 가까운 것이라고 생각합니다.
날짜가 있지만 여전히 관련이있는 Scala 문서 사용시 @dcsobral의 post과 Haskell의 Hoogle과 유사한 Scalex이 있습니다.
이것은 Object
Array
의 탭 완성입니다.
scala> Array.
apply asInstanceOf canBuildFrom concat copy
empty emptyBooleanArray emptyByteArray emptyCharArray emptyDoubleArray
emptyFloatArray emptyIntArray emptyLongArray emptyObjectArray emptyShortArray
fallbackCanBuildFrom fill isInstanceOf iterate newBuilder
ofDim range tabulate toString unapplySeq
이것은 Array
클래스의 메소드입니다. 방법에 번 탭 완료시 조금 어려운이 메소드 서명을 표시하지만이 a.
scala> val a = Array(1,2,3)
a: Array[Int] = Array(1, 2, 3)
scala> a.
apply asInstanceOf clone isInstanceOf length toString update
후 값 회원을 표시하지 않는 이유를 확실하지. 여기가 scaladoc을 찾는위한 sbt 플러그인은 Array.fill
def fill[T](n1: Int, n2: Int)(elem: => T)(implicit evidence$10: reflect.ClassTag[T]): Array[Array[T]]
def fill[T](n1: Int, n2: Int, n3: Int)(elem: => T)(implicit evidence$11: reflect.ClassTag[T]): Array[Array[Array[T]]]
def fill[T](n1: Int, n2: Int, n3: Int, n4: Int)(elem: => T)(implicit evidence$12: reflect.ClassTag[T]): Array[Array[Array[Array[T]]]]
def fill[T](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(elem: => T)(implicit evidence$13: reflect.ClassTag[T]): Array[Array[Array[Array[Array[T]]]]]
def fill[T](n: Int)(elem: => T)(implicit evidence$9: reflect.ClassTag[T]): Array[T]
탭 완료는 implicits를 통해 추가 된 멤버를 수행하지 않습니다. 그러나 탭핑은 나를 위해 scaladoc보다 쉽습니다 (반사 API가 마음에 듭니다). –
흠 탭 완성은 파이썬의'help()'보다 덜 우아 해 보입니다 만, 그 목적을 달성 한 것 같습니다. 고맙습니다! – Ray
sbt-man을 위해이다. REPL에서
man Traversable /:
[man] scala.collection.Traversable
[man] def /:[B](z: B)(op: (B ⇒ A ⇒ B)): B
[man] Applies a binary operator to a start value and all elements of this
collection, going left to right. Note: /: is alternate syntax for foldLeft;
z /: xs is the same as xs foldLeft z. Note: will not terminate for infinite-
sized collections. Note: might return different results for different runs,
unless the underlying collection type is ordered. or the operator is
associative and commutative.
- 1. 스칼라와 util.Iterator [_]
- 2. 스칼라와 Node.js를
- 3. 스칼라와 스칼라에서
- 4. 스칼라와 UnionTypes
- 5. 진수 계산기 도움말 - 파이썬
- 6. 파이썬 도움말 : OOP 직사각형
- 7. 파이썬 OSX에 설치 도움말
- 8. 파이썬 사전 /리스트 도움말
- 9. 엑셀 CSV 도움말 파이썬
- 10. 초보자를위한 파이썬 로깅 도움말
- 11. 파이썬 서브 프로세스 도움말
- 12. 초보자를위한 파이썬 프로그래밍 도움말?
- 13. 기본 시도 : 도움말 파이썬
- 14. 파이썬 코드 도움말
- 15. 파이썬 프로그래밍 도움말
- 16. 다시 파이썬 도움말
- 17. 웹에서 파이썬 도움말
- 18. 파이썬 부울 도움말!
- 19. 파이썬 : 줄 바꿈 문자로 도움말
- 20. 도움말 Tkinter로 파이썬 클래스 생성하기
- 21. 파이썬 좌표 충돌 도움말 원함
- 22. 파이썬 도움말() 함수와 string.title 기능
- 23. 파이썬 스크립트에 대한 도움말 작성
- 24. 파이썬 도움말 : 없음 조건문, 또는
- 25. 파이썬 도움말 : 웹 사이트에 로그인
- 26. 파이썬 도움말 - 사전, 키, 값
- 27. 파이썬 도움말. 진술이 작동하지 않는다면?
- 28. 시뮬레이션을위한 스칼라와 AKKA
- 29. 스칼라와 @Inject 어노테이션
- 30. 스칼라와 자바 배열
탭 완료시 : SBT
console
명령은 클래스 경로예에 프로젝트 클래스와 의존성 스칼라 REPL을 시작? – sschaef