Vle-cdrassoc

提供:GizmoLabs - だいたい CAD LISP なサイト
構文
(vle-cdrassoc key lst)


機能
ドットペアリスト lst から key を持つドットペアの値を返す。


引数
  • key : 検索するドットペアのキー値。
  • lst : 検索されるドットペアリスト。


戻り値
'lst' のドットペア(key value)に key が存在する場合はその value値。
存在しない場合は nil。


  • エンティティリストから値を取り出すのに便利
  • (cdr (assoc key lst)) を実行したのと同じ。

エイリアス: vle-get-cdrassocvle-get-cassocvle-cassoc


サンプル

<syntaxhighlight lang="lisp" line> (vle-cdrassoc 11 '((1 . "a")(2 . "b")(11 . "xx")(22 . "yy"))) returns "xx"

(vle-cdrassoc 0 '((1 . "a")(2 . "b")(11 . "xx")(22 . "yy")))

nil

(vle-cdrassoc 22 '((1 . "a")(2 . "b")(11 . "xx")(22 . 123) (22 . 345))) 123

(vle-cdrassoc 0 '(1 2 3)) エラー

(vle-cassoc 11 '((1 . "a")(2 . "b")(11 . "xx")(22 . "yy"))) returns "xx" </syntaxhighlight>



関連事項