Mercerenies / gdlisp

Lisp on the Godot platform
GNU General Public License v3.0
141 stars 1 forks source link

setget Accessors #12

Closed Mercerenies closed 2 years ago

Mercerenies commented 3 years ago

setget accessors.

It is possible we could opt not to bind them to field names like GDScript does (we would internally compile them to be bound to a dummy field) and just have getters and setters stand on their own.

(defn (get foo) () ...)
(defn (set foo) () ...)

Or we could go the more traditional route and follow GDScript's example.

(defvar foo (setget set-foo get-foo))
Mercerenies commented 2 years ago

Closed as of f1d8b9a89c68956019dfffcd71463ab25b8c9e7c, using the syntax listed in the first code snippet above.