File: standard-generic-function.lsp

package info (click to toggle)
gcl27 2.7.1-13
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 30,888 kB
  • sloc: lisp: 211,946; ansic: 52,944; sh: 9,347; makefile: 647; tcl: 53; awk: 52
file content (45 lines) | stat: -rw-r--r-- 864 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Tue May 20 06:47:20 2003
;;;; Contains: Additional tests for class STANDARD-GENERIC-FUNCTION

(in-package :cl-test)

;;; Most tests of this are elsewhere

(unless (typep #'cons 'generic-function)

(deftest standard-generic-function.1
  (progn
    (eval
     '(defgeneric sgf-cpl-gf.1 (x)
	(:method ((x generic-function)) 1)
	(:method ((x function)) 2)
	(:method ((x t)) 3)))
    (values
     (sgf-cpl-gf.1 #'make-instance)
     (sgf-cpl-gf.1 #'cons)
     (sgf-cpl-gf.1 'a)))
  1 2 3)

(deftest standard-generic-function.2
  (progn
    (eval
     '(defgeneric sgf-cpl-gf.2 (x)
	(:method ((x standard-generic-function)) 1)
	(:method ((x function)) 2)
	(:method ((x t)) 3)))
    (values
     (sgf-cpl-gf.2 #'make-instance)
     (sgf-cpl-gf.2 #'cons)
     (sgf-cpl-gf.2 'a)))
  1 2 3)


)