Skip to content

Instantly share code, notes, and snippets.

@bowbow99
Created December 14, 2010 15:39
Show Gist options
  • Select an option

  • Save bowbow99/740588 to your computer and use it in GitHub Desktop.

Select an option

Save bowbow99/740588 to your computer and use it in GitHub Desktop.
xyzzy では structure の accessor で全く関係ない structure の slot に触れてしまうことに気づいた。
;; xyzzy では structure の accessor で全く関係ない structure の slot に触れてしまう事に気づいた。
(defstruct foo
bar baz)
=> #<structure-definition: foo>
(defstruct hoge
fuga piyo)
=> #<structure-definition: hoge>
(hoge-fuga (make-foo :bar 3 :baz 4))
=> 3
@bowbow99
Copy link
Author

いちいちインスタンスをチェックするようにするとか、ついでに使われてない :type 使って型チェックもするとか、それほど難しくはないのだけど、速度的なトコが心配。
(declare (optimize ...)) で省略できるようにすればいいんだろうけど、そうすると compile.l いぢることになるんで、そこまですんの?と。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment