Conversation
…er enhancements and bug fixes
jltaylor-us
left a comment
There was a problem hiding this comment.
Cool! CSUG updates coming?
I suppose theoretically all of the edited files that have the standard copyright / license header should have the copyright date updated.
|
Will there be a way to ask if an object implements an interface without walking the result of |
|
已收到
|
|
@jltaylor-us I will add csug updates and a release note when and if we decide to proceed with this. Thanks for the fixes, which will be incorporated in my next commit. |
|
@gwatt |
|
Would the facilities for custom readers, writers, hash functions, and equality tests that are currently present in Chez Scheme be made part of this interface facility? |
interfaces; added new open-interface form; various other changes. see LOG for details.
|
@sunderroy Yes, there's nothing preventing operations on records in general from working on records with methods. |
…ization; added tests of same
| (error? ; invalid syntax | ||
| (define-interface (rat israt?) (methods a b c))) | ||
| (error? ; invalid syntax | ||
| (define-interface rat (mehtods))) |
There was a problem hiding this comment.
(define-interface rat (mehtods))should be
(define-interface rat (methods))
This pull request extends
define-record-typewith methods, effectively convertingdefine-record-typeinto a class-definition form in support of object-oriented programming. It adds adefine-interfaceform and adefine-record-typeimplementsclause to support multiple interface inheritance. While object-oriented programming obscures control flow, tends to encourage an overly imperative style of programming, and is often overused when it's available, it has its uses when used judiciously. This particular OOP subsystem, at least, supports a functional style of programming: allocation and initialization is inexpensive as well as functional, and fields are immutable by default. The essentials of the implementation come from adefine-classform that Oscar Waddel and I designed and implemented many years ago, the code for which had been sitting in mats/oop.ss; only its recasting into an extension ofdefine-record-typeis new.The pull request adds a couple of other things that are useful independently of the support for methods and interfaces; these are described in the LOG.