/usr/share/scsh-0.6/misc/test-doodl.scm is in scsh-common-0.6 0.6.7-8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 46 47 48 49 50 | ; Copyright (c) 1993-1999 by Richard Kelsey and Jonathan Rees. See file COPYING.
; ((method () 1)) => 1
; ((method () 1) 2) => error
; ((method (x) 1) 2) => 1
; ((method ((x <symbol>)) 1) 2) => error
; ((method ((x <symbol>)) 1) 'foo) => 1
; ((method ((x <symbol>)) (next-method)) 'foo) => error
(define-generic-function elt ((s <sequence>)))
(define-method elt ((x <vector>) y)
(vector-ref x y))
; (elt '#(a b c) 1) => b
(define-method elt ((x <string>) y)
(string-ref x y))
(define-method elt ((x <list>) y)
(list-ref x y))
; Setters
(define-generic-function (setter elt)
(thing index new-value))
(define-method (setter elt) ((x <vector>) i z)
(vector-set! x i z))
; (let ((v (vector 1 2 3))) (set (elt v 1) 'foo) v) => '#(1 foo 3)
; Classes
(define-class <mumble> () a b)
; (a (make <mumble>)) => '*uninitialized*
; (let ((m (make <mumble>))) (set (a m) 'foo) (a m)) => 'foo
(define-method initialize ((m <mumble>) z)
(set (a m) z))
; (a (make <mumble> 3)) => 3
|