[PC周辺] Emacs22 の split-string の挙動 (20061227)

最近 Emacs22 を使いはじめて,

% dpkg -l 'emacs-snapshot*' | grep ^ii
ii  emacs-snapshot            20061221-1     The GNU Emacs editor (development snapshot)
ii  emacs-snapshot-bin-common 20061221-1     The GNU Emacs editor's shared, architecture 
ii  emacs-snapshot-common     20061221-1     The GNU Emacs editor's common infrastructure

で,

GNU Emacs 22.0.92.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2006-12-22 on pacem, modified by Debian

みたいな環境なのであるが,なんだか自前の関数の挙動が変だなぁと思ってい たら split-string の挙動が Emacs21 と異っているっぽい.

上記の例だとわかりにくいが, たとえば以下だと Emacs22 の (subr.el の) 方が素直な気がする.

ちなみに関係ないが Ruby の String#split の場合は,

"0 1 2".split(/\s+/)  =>["0", "1", "2"]
" 0 1 2".split(/\s+/) =>["", "0", "1", "2"]
"0 1 2".split(" ")    =>["0", "1", "2"]
" 0 1 2".split(" ")   =>["0", "1", "2"]

みたいな.


Last-modified: Wed May 06 00:14:17 +0900 2009

全インデックス