|
@@ -211,6 +211,10 @@ Actions:
|
|
(sell-transaction item-to-sell quantity)
|
|
(sell-transaction item-to-sell quantity)
|
|
(trade-menu)))))
|
|
(trade-menu)))))
|
|
|
|
|
|
|
|
+(defmacro dynamic-slot-access (predicate slotname accessor)
|
|
|
|
+ "Given a predicate where the predicate is a struct slot accessor like 'market-price-of-',
|
|
|
|
+ an 'accessor' like 'petrofuel', and a struct location, return the slot accessor function"
|
|
|
|
+ `(funcall ,(symbol-function (find-symbol (string-upcase (concatenate 'string predicate slotname)))) ,accessor))
|
|
|
|
|
|
(defun display-prices ()
|
|
(defun display-prices ()
|
|
;;; (funcall (symbol-function (find-symbol (string-upcase (concatenate 'string "market-price-of-" item)))) (sector-market *sector*)) ;;; A call by string reference method for function calls
|
|
;;; (funcall (symbol-function (find-symbol (string-upcase (concatenate 'string "market-price-of-" item)))) (sector-market *sector*)) ;;; A call by string reference method for function calls
|