faster dictionary?
Posted: Sat Mar 08, 2008 3:22 am
				
				Which is faster(just curious, not optimizing); a dictionary built like:
or using the context with a custom function like:
Faster(more efficient etc.) in terms of creation and use. This for small dictionaries of fixed size.
--hsm
			Code: Select all
(set 'board '(
  ("a1" ("r" "w"))
  ("b1" ("n" "w"))
  ("c1" ("b" "w"))
  ("d1" ("q" "w"))
  ("e1" ("k" "w"))
  ("f1" ("b" "w"))
  ("g1" ("n" "w"))
  ("h1" ("r" "w"))))
Code: Select all
  (board "a1" (list "r" "w" "w"))
  (board "b1" (list "n" "w" "b"))
  (board "c1" (list "b" "w" "w"))
  (board "d1" (list "q" "w" "b"))
  (board "e1" (list "k" "w" "w"))
  (board "f1" (list "b" "w" "b"))
  (board "g1" (list "n" "w" "w"))
  (board "h1" (list "r" "w" "b"))
--hsm