@@ -6,10 +6,18 @@ Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
66License: See License.txt in this distribution for details.
77Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
88
9+ define dood-class <copy-down-method-definition> (<method-definition>)
10+ lazy constant slot form-specializing-signature,
11+ required-init-keyword: specializing-signature:;
12+ end ;
913
1014define &definition copy-down-method-definer
15+ { define ?mods:* \copy-down-method ?:name ?signature:*
16+ specializing ?specializing-signature:* }
17+ => do-define-copy-down-method(form, mods, name, signature,
18+ specializing-signature);
1119 { define ?mods:* \copy-down-method ?:name ?signature:* }
12- => do-define-copy-down-method (form, mods, name, signature) ;
20+ => do-define-copy-down-method(form, mods, name, signature, #f ) ;
1321 { define ?mods:* \copy-down-method ?other:* }
1422 => begin
1523 note(<malformed-define-method>,
@@ -18,53 +26,31 @@ define &definition copy-down-method-definer
1826 end ;
1927end ;
2028
21- /*
22- define function do-define-copy-down-method (fragment, mods, name, signature)
23- format-out ("in do-define-copy-down-method\n");
24- // let (options, adjectives) = parse-method-adjectives (name, mods);
25- format-out ("copy-down-method signature is %s\n", signature) ;
26- // maybe should check body is empty
27- // ensure-next-method-binding (signature); // not sure this useful
28- // let args-list = macro-case (signature) { (?args:*) ?other:* } => args end;
29- let method-form
30- = #{ define ?mods \method ?name ?signature end };
31- let new-fragment = method-form.as-body ;
32- let expanded-forms = top-level-convert (fragment, new-fragment) ;
33- format-out ("expanded forms for copy-down method %s\n", expanded-forms) ;
34- let interesting-form = first (expanded-forms) ;
35- interesting-form.form-class := #"copy-down-method" ;
36- expanded-forms
37- end;
38- */
39- define function do-define-copy-down-method (fragment, mods, name, signature)
40- // format-out ("in do-define-copy-down-method\n");
29+ define function do-define-copy-down-method
30+ (fragment, mods, name, sig-fragment, specializing-sig-fragment)
4131 let (options, adjectives) = parse-method-adjectives (name, mods);
42- // let signature-and-body = make (<sequence-fragment>,
43- // record: signature.fragment-record,
44- // source-position: signature.fragment-source-position,
45- // fragments:
46- // concatenate (signature . fragment-fragments,
47- // #{ #f }.template-fragments)) ;
48- let signature-and-body = signature ;
49- let (signature, body) = parse-method-signature(name, signature-and-body);
50- // format-out ("copy-down-method signature is %s\n", signature) ;
32+ let (signature, body) = parse-method-signature(name, sig-fragment);
5133 ensure-next-method-binding (signature);
34+ let specializing-signature
35+ = specializing-sig-fragment
36+ & parse-method-signature(name, specializing-sig-fragment);
5237 let method-definition
53- = apply (make , <method-definition>,
38+ = apply (make , <copy-down- method-definition>,
5439 source-location: fragment-source-location(fragment),
5540 variable-name: name,
5641 adjectives: adjectives,
5742 signature: signature,
43+ specializing-signature: specializing-signature,
5844 body: body,
59- signature-and-body-fragment: signature ,
45+ signature-and-body-fragment: sig-fragment ,
6046 options);
61- method-definition.form-class := # "copy-down-method" ;
47+ method-definition.form-class := # "copy-down-method" ;
6248 if (form-sealed?(method-definition))
6349 let domain-fragment
6450 = generate-implicit-domain-definition-fragment(method-definition);
65- let expanded-forms = top-level-convert(method-definition, domain-fragment) ;
66- pair (method-definition, expanded-forms)
51+ let expanded-forms = top-level-convert(method-definition, domain-fragment);
52+ pair (method-definition, expanded-forms)
6753 else
68- list (method-definition)
54+ list (method-definition)
6955 end
7056end ;
0 commit comments