Enumerableのzip
プログラミング言語 Ruby リファレンスマニュアル
引数に渡した配列の各要素からなる配列の配列を生成して返します。
p [1,2,3].zip([4,5,6]) => [[1, 4], [2, 5]]
Arrayのcompact
プログラミング言語 Ruby リファレンスマニュアル
compact は self から nil である要素を取り除いた新しい配列を返します。
liftwebからダウンロードしたもの
Lift :: Download
からダウンロードしたもの
#Project properties
#Fri Apr 23 11:24:20 PDT 2010
project.organization=Lift
project.name=Lift SBT Template
sbt.version=0.7.4
project.version=0.1
def.scala.version=2.7.7
build.scala.versions=2.8.0
project.initialize=false
Lift :: Getting Started
からダウンロードしたものはbuild.scala.versionsが古かった。
liftのインストール手順
Then cd into lift_sbt_prototype and type:
sbtAt the sbt prompt, type:
updateThen:
jetty-runPoint your browser to:
http://localhost:8080/
文字列を分割してリストにする
scala> "1 2 3" res0: java.lang.String = 1 2 3 scala> res0.split(" ") res2: Array[java.lang.String] = Array(1, 2, 3) scala> res2.toList res3: List[java.lang.String] = List(1, 2, 3)
splitで分割したらArrayになって、toListでListになる。