From a52a10871b45806db86476fc17092368bcc5b1c3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 9 Feb 2021 07:45:05 -0800 Subject: struct: changing meaning of obj.[fun ...] syntax. Until now, the obj.[fun ...] syntax has uselessly denoted exactly the same thing as [obj.fun ...]. This latter syntax is what should be used for that meaning. The new meaning of obj.[fun ...] will be that it performs method dispatch, where obj is passed to obj.fun as the leftmost argument: obj.[fun ...] is [obj.fun obj ...], with obj evaluated once. * share/txr/stdlib/struct.tl (qref): Expansion change done here, with backward compat switch. * share/txr/stdlib/termios.tl (termios (go-raw, go-cbreak)): Some a.[b c] turned to [a.b c] here. * tests/012/oop.tl (animal print): Likewise. * tests/012/struct.tl: Likewise, and some expansion tests updated to reflect the new expansion. * txr.1: Documentation revised in multiple places and compat note added. --- tests/012/oop.tl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/012/oop.tl') diff --git a/tests/012/oop.tl b/tests/012/oop.tl index 51dadbf3..ac93790f 100644 --- a/tests/012/oop.tl +++ b/tests/012/oop.tl @@ -2,7 +2,7 @@ (defstruct animal nil (:function whoami () "n/a") - (:method print (self stream : pretty-p) (put-string self.[whoami] stream))) + (:method print (self stream : pretty-p) (put-string [self.whoami] stream))) (defstruct dog animal (:function whoami () "dog")) -- cgit v1.2.3