fork download
  1. ; your code goes here
  2.  
  3. (defparameter *config* (make-hash-table))
  4.  
  5. (defmacro get-value (name)
  6. (multiple-value-bind (v exist) (gethash name *config*)
  7. (if exist
  8. v
  9. (error (format nil "no config value for ~a" name)))))
  10.  
  11. (defun set-value (name value)
  12. (setf (gethash name *config*) value))
  13.  
  14. (set-value 'shard 5)
  15.  
  16. (format t "shard: ~a~%" (get-value shard))
  17. (get-value shard1)
Runtime error #stdin #stdout #stderr 0.01s 10696KB
stdin
Standard input is empty
stdout
shard: 5
stderr
*** - no config value for SHARD1