Mercerenies / gdlisp

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

Fill in implied getters/setters with an error #75

Closed Mercerenies closed 1 year ago

Mercerenies commented 2 years ago

Following onto #12, if we define either a getter or a setter but not the other one, the other will be omitted from the generated code. Effectively, this means that, if we omit a setter, then the implied setter will do nothing. Likewise, if we omit a getter, the implied getter will return null constantly.

I propose the following signatures for partial setget declarations on proxy fields.

;; Getter was omitted
func __gdlisp_get_foo():
    push_error("Cannot access nonexistent field foo")

;; Setter was omitted
func __gdlisp_set_foo(arg_0):
    push_error("Cannot assign to nonexistent field foo")