Hi guys,
is it possible to set hash items at once in hash definition?
;; this works
(define cities:cities)
(cities "ny" "new york")
(cities "sf" "san francisco")
(println (cities "sf"))
;; this not
(define cities:cities '(
("ny" "new york")
("sf" "san francisco")))
(println (cities "sf"))
Hi,
Try
(define cities:cities) ; creates the default functor
(cities '(("ny" "new york") ("sf" "san francisco"))) ; the functor adds the data
(cities)
s.v.
And you can of course combine it into a single phrase like
((or (define cities:cities) cities)
'(("ny" "new york") ("sf" "san francisco")))
but it's not very intelligible.