GithubHelp home page GithubHelp logo

list-length の新たなバグ about xyzzy HOT 3 CLOSED

coffee-p avatar coffee-p commented on August 11, 2024
list-length の新たなバグ

from xyzzy.

Comments (3)

kosh04 avatar kosh04 commented on August 11, 2024

list-length の引数に proper list (cdr 部分が nil で終了しているリスト) あるいは循環リスト以外を渡した場合にエラーになる挙動は Common Lisp 仕様のようで、むしろ今まであったバグを修正したものかと思います。

参考: http://clhs.lisp.se/Body/f_list_l.htm

また、この挙動の修正は ver 0.2.2.236 にて行われたようです。
http://xyzzy-022.github.io/xyzzy/2012/03/29/xyzzy-0_2_2_236-release-note/

(list-length '(a . b))
=> 不正なデータ型です: b: list

from xyzzy.

coffee-p avatar coffee-p commented on August 11, 2024

kosh04さん、色々調べて下さったようでありがとうございます。小生の早トチリのようで撤回します。
しかし、まだ疑問があります。そもそも、小生か疑問を抱いたきっかけは (last '(1 2 . 3)) がエラーをはくということでした。パニくった小生は list-length でもエラーになつたので v0.235のソース list.cc を(わかりもしないのに)見にいきました。そこには有名な兎と亀の論法らしきものが戴っていました。しかし、新にダウンロードしたV.253 には内部関数(?)の xlist_length は通常の length と同じ論法(list のlength)と同じようにみえたのです。つまり、last のバグが内部関数 xlist-length ではなく builtin の list-length だと早トチリしたわけです。さらに早トチリは暴走し、V238の改定によりバグが発生したと断定してしまいました。
小生の早トチリと刺激的なタイトルをつけたことをお詑びします。また、kosh04さんには御足労をおかけして申し訳ありませんでした。

from xyzzy.

kosh04 avatar kosh04 commented on August 11, 2024

list-length の件は一応解決したかと思いますが、(last '(1 2 . 3)) がエラーを吐くのは確かに奇妙ですね。本来なら (2 . 3) が返ってくるはず。
気になる場合は一旦この件はクローズして、改めて issue を立ててみてはどうでしょうか?

from xyzzy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.