* unbound location: *
@ 2023-11-01 8:39 Damien Mattei
2023-11-01 12:22 ` Damien Mattei
0 siblings, 1 reply; 12+ messages in thread
From: Damien Mattei @ 2023-11-01 8:39 UTC (permalink / raw)
To: kawa mailing list
hello,
i created a module this way:
(module-name "matrix")
(export multiply-matrix-matrix
multiply-matrix-vector
matrix
matrix-v
create-matrix-by-function
dim-matrix
matrix-ref
matrix-set!
matrix-line-ref
matrix-line-set!
vector->matrix-column
matrix-column->vector
*)
(require Scheme+)
;; (matrix #(1 2 3))
;; matrix@4612b856
(define-simple-class matrix ()
(v :: vector)
((*init* (vParam :: vector))
(set! v vParam))
)
(display "multiply : * =") (display *) (newline)
;; (define M (create-matrix-by-function (lambda (i j) (+ i j)) 2 3))
(define (create-matrix-by-function fct lin col)
(matrix (create-vector-2d fct lin col)))
;; return the line and column values of dimension
;; (dim-matrix M)
;; 2 3
(define (dim-matrix M)
(when (not (matrix? M))
(error "argument is not of type matrix"))
{v <+ (matrix-v M)}
{lin <+ (vector-length v)}
{col <+ (vector-length {v[0]})}
(values lin col))
;; #|kawa:85|# (define M1 (create-matrix-by-function (lambda (i j) (+
i j)) 2 3))
;; #|kawa:86|# (define M2 (create-matrix-by-function (lambda (i j) (+
i j)) 3 2))
;; #|kawa:87|# (multiply-matrix-matrix M1 M2)
;; matrix@3fc1abf
;; #|kawa:88|# (define M1*M2 (multiply-matrix-matrix M1 M2))
;; #|kawa:89|# M1*M2
;; matrix@3bf5911d
;; #|kawa:90|# (matrix-v M1*M2)
;; #(#(5 8) #(8 14))
;; #|kawa:91|# (matrix-v M1)
;; #(#(0 1 2) #(1 2 3))
;; #|kawa:92|# (matrix-v M2)
;; #(#(0 1) #(1 2) #(2 3))
(define (multiply-matrix-matrix M1 M2)
{(n1 p1) <+ (dim-matrix M1)}
{(n2 p2) <+ (dim-matrix M2)}
(when {p1 ≠ n2} (error "matrix.* : matrix product impossible,
incompatible dimensions"))
{v1 <+ (matrix-v M1)}
{v2 <+ (matrix-v M2)}
(define (res i j)
{sum <+ 0}
(for ({k <+ 0} {k < p1} {k <- k + 1})
{sum <- sum + v1[i][k] * v2[k][j]})
(display "sum=")(display sum) (newline)
sum)
{v <+ (create-vector-2d res n1 p2)}
(matrix v))
(overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
....
i cut off the whole code, the code used to works with 'include' , now
that i try with modules i stuck on this error at the line
(overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
note that matrix+.scm is converted externally in matrix.scm :
(module-name "matrix")
(export multiply-matrix-matrix multiply-matrix-vector matrix matrix-v
create-matrix-by-function dim-matrix matrix-ref matrix-set! matrix-line-ref
matrix-line-set! vector->matrix-column matrix-column->vector *)
(require Scheme+)
(define-simple-class matrix () (v :: vector)
((*init* (vParam :: vector)) (set! v vParam)))
(display "multiply : * =")
(display *)
(newline)
(define (create-matrix-by-function fct lin col)
(matrix (create-vector-2d fct lin col)))
(define (dim-matrix M)
(when (not (matrix? M)) (error "argument is not of type matrix"))
(<+ v (matrix-v M)) (<+ lin (vector-length v))
(<+ col (vector-length (bracket-apply v 0))) (values lin col))
(define (multiply-matrix-matrix M1 M2) (<+ (n1 p1) (dim-matrix M1))
(<+ (n2 p2) (dim-matrix M2))
(when (|≠| p1 n2)
(error "matrix.* : matrix product impossible, incompatible dimensions"))
(<+ v1 (matrix-v M1)) (<+ v2 (matrix-v M2))
(define (res i j) (<+ sum 0)
(for ((<+ k 0) (< k p1) ($nfx$ k <- k + 1))
($nfx$ sum <- sum + (bracket-apply (bracket-apply v1 i) k) *
(bracket-apply (bracket-apply v2 k) j)))
(display "sum=") (display sum) (newline) sum)
(<+ v (create-vector-2d res n1 p2)) (matrix v))
(overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
(define (matrix-v M) (slot-ref M (quote v)))
(define (vector->matrix-column v)
(matrix (vector-map (lambda (x) (make-vector 1 x)) v)))
(define (matrix-column->vector Mc) (<+ v (matrix-v Mc))
(vector-map (lambda (v2) (bracket-apply v2 0)) v))
(define (multiply-matrix-vector M v) (<+ Mc (vector->matrix-column v))
(matrix-column->vector (multiply-matrix-matrix M Mc)))
(define (matrix-ref M lin col) (<+ v (matrix-v M))
(bracket-apply (bracket-apply v lin) col))
(define (matrix-set! M lin col x) (<+ v (matrix-v M))
(<- (bracket-apply (bracket-apply v lin) col) x))
(define (matrix-line-ref M lin) (<+ v (matrix-v M)) (bracket-apply v lin))
(define (matrix-line-set! M lin vect-line) (<+ v (matrix-v M))
(<- (bracket-apply v lin) vect-line))
(overload-square-brackets matrix-ref matrix-set! (matrix? number? number?))
(overload-square-brackets matrix-line-ref matrix-line-set! (matrix? number?))
overload-existing-operator redefine the * operator , so basically it
needs the original one to not loose the * between numbers
the code is:
(define-syntax overload-existing-operator
(syntax-rules ()
((_ orig-funct funct (pred-arg1 ...))
(define orig-funct (create-overloaded-existing-operator
orig-funct funct (list pred-arg1 ...))))))
(define (create-overloaded-existing-operator orig-funct funct
pred-list) ;; works for associative operators
(display "create-overloaded-existing-operator")
(display " : pred-list = ") (display pred-list) (newline)
(define old-funct orig-funct)
(define new-funct (lambda args ;; args is the list of arguments
;; (display "new-funct: new-funct = ") (display
new-funct) (newline)
;; (display "new-funct : pred-list = ") (display
pred-list) (newline)
;; (display "new-funct : args = ") (display args) (newline)
(define nb-args (length args))
;;(display "new-funct : nb-args = ") (display nb-args) (newline)
(cond ((check-arguments pred-list args) ;;(begin
;;(display "new funct :calling:")
(display funct) (newline)
(apply funct args));;)
((> nb-args 2) (new-funct (car args)
(apply new-funct (cdr args)))) ;;
op(a,b,...) = op(a,op(b,...))
(else
;;(begin
;;(display "new funct :calling: ") (display
old-funct) (newline)
(apply old-funct args)))));;)
(display "funct: ") (display funct) (newline)
(display "orig-funct: ") (display orig-funct) (newline)
(display "old-funct: ") (display old-funct) (newline)
(display "new-funct: ") (display new-funct) (newline)
(replace-operator! orig-funct new-funct)
new-funct)
this weird code return the new-funct which is the overloaded * , at
the line (overload-existing-operator * multiply-matrix-matrix
(matrix? matrix?))
i got this error:
Exception in thread "main" java.lang.ExceptionInInitializerError
at atInteractiveLevel-8.run(exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa+.scm:43)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
at kawa.Shell.run(Shell.java:289)
at kawa.Shell.runFile(Shell.java:551)
at kawa.standard.load.apply2(load.java:67)
at kawa.standard.load.apply1(load.java:27)
at gnu.mapping.Procedure1or2.applyToObject(Procedure1or2.java:64)
at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
at kawa.Shell.run(Shell.java:289)
at kawa.Shell.run(Shell.java:196)
at kawa.Shell.run(Shell.java:183)
at kawa.repl.processArgs(repl.java:724)
at kawa.repl.main(repl.java:830)
Caused by: /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/kawa/matrix.scm:9:10:
unbound location: *
at gnu.mapping.PlainLocation.get(PlainLocation.java:22)
at matrix.<clinit>(matrix.scm:9)
... 17 more
ok * seems not bound to any procedure
when i display it for debug i got:
multiply : * =%
note that % is in reversed colors (white on black background) i cannot
copy/paste it....
all the code is called from a main file:
(require matrix)
(require array)
(require Scheme+)
it seems in a module * is not bound to anything, i had a same problem
in Racket where i need to import racket/base, is there such a need in
Kawa? ,i can find anything related in the doc.
regards,
damien
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: unbound location: *
2023-11-01 8:39 unbound location: * Damien Mattei
@ 2023-11-01 12:22 ` Damien Mattei
2023-11-01 12:50 ` Damien Mattei
2023-11-01 14:55 ` Per Bothner
0 siblings, 2 replies; 12+ messages in thread
From: Damien Mattei @ 2023-11-01 12:22 UTC (permalink / raw)
To: kawa mailing list
here is a counter example:
;; test-define.scm
(module-name test-define)
(export *)
(display *) (newline)
(define * +)
(display *) (newline)
;; main-test-define.scm
(require test-define)
(define rv (* 2 3))
(display rv) (newline)
#|kawa:1|# (load
"/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
#<procedure +>
#<procedure +>
5
but i do not quite understand , first display shoud have display #<procedure *>
but no it displays #<procedure +>
On Wed, Nov 1, 2023 at 9:39 AM Damien Mattei <damien.mattei@gmail.com> wrote:
>
> hello,
>
> i created a module this way:
>
> (module-name "matrix")
>
> (export multiply-matrix-matrix
> multiply-matrix-vector
> matrix
> matrix-v
> create-matrix-by-function
> dim-matrix
> matrix-ref
> matrix-set!
> matrix-line-ref
> matrix-line-set!
> vector->matrix-column
> matrix-column->vector
> *)
>
> (require Scheme+)
>
>
> ;; (matrix #(1 2 3))
> ;; matrix@4612b856
>
>
> (define-simple-class matrix ()
>
> (v :: vector)
>
> ((*init* (vParam :: vector))
> (set! v vParam))
>
> )
>
> (display "multiply : * =") (display *) (newline)
>
>
> ;; (define M (create-matrix-by-function (lambda (i j) (+ i j)) 2 3))
> (define (create-matrix-by-function fct lin col)
> (matrix (create-vector-2d fct lin col)))
>
>
> ;; return the line and column values of dimension
> ;; (dim-matrix M)
> ;; 2 3
> (define (dim-matrix M)
>
> (when (not (matrix? M))
> (error "argument is not of type matrix"))
>
> {v <+ (matrix-v M)}
> {lin <+ (vector-length v)}
> {col <+ (vector-length {v[0]})}
> (values lin col))
>
> ;; #|kawa:85|# (define M1 (create-matrix-by-function (lambda (i j) (+
> i j)) 2 3))
> ;; #|kawa:86|# (define M2 (create-matrix-by-function (lambda (i j) (+
> i j)) 3 2))
> ;; #|kawa:87|# (multiply-matrix-matrix M1 M2)
> ;; matrix@3fc1abf
> ;; #|kawa:88|# (define M1*M2 (multiply-matrix-matrix M1 M2))
> ;; #|kawa:89|# M1*M2
> ;; matrix@3bf5911d
> ;; #|kawa:90|# (matrix-v M1*M2)
> ;; #(#(5 8) #(8 14))
> ;; #|kawa:91|# (matrix-v M1)
> ;; #(#(0 1 2) #(1 2 3))
> ;; #|kawa:92|# (matrix-v M2)
> ;; #(#(0 1) #(1 2) #(2 3))
> (define (multiply-matrix-matrix M1 M2)
>
> {(n1 p1) <+ (dim-matrix M1)}
> {(n2 p2) <+ (dim-matrix M2)}
>
> (when {p1 ≠ n2} (error "matrix.* : matrix product impossible,
> incompatible dimensions"))
>
> {v1 <+ (matrix-v M1)}
> {v2 <+ (matrix-v M2)}
>
> (define (res i j)
> {sum <+ 0}
> (for ({k <+ 0} {k < p1} {k <- k + 1})
> {sum <- sum + v1[i][k] * v2[k][j]})
> (display "sum=")(display sum) (newline)
> sum)
>
> {v <+ (create-vector-2d res n1 p2)}
>
> (matrix v))
>
>
>
> (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
>
>
>
> ....
>
> i cut off the whole code, the code used to works with 'include' , now
> that i try with modules i stuck on this error at the line
> (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
>
> note that matrix+.scm is converted externally in matrix.scm :
>
> (module-name "matrix")
> (export multiply-matrix-matrix multiply-matrix-vector matrix matrix-v
> create-matrix-by-function dim-matrix matrix-ref matrix-set! matrix-line-ref
> matrix-line-set! vector->matrix-column matrix-column->vector *)
> (require Scheme+)
> (define-simple-class matrix () (v :: vector)
> ((*init* (vParam :: vector)) (set! v vParam)))
> (display "multiply : * =")
> (display *)
> (newline)
> (define (create-matrix-by-function fct lin col)
> (matrix (create-vector-2d fct lin col)))
> (define (dim-matrix M)
> (when (not (matrix? M)) (error "argument is not of type matrix"))
> (<+ v (matrix-v M)) (<+ lin (vector-length v))
> (<+ col (vector-length (bracket-apply v 0))) (values lin col))
> (define (multiply-matrix-matrix M1 M2) (<+ (n1 p1) (dim-matrix M1))
> (<+ (n2 p2) (dim-matrix M2))
> (when (|≠| p1 n2)
> (error "matrix.* : matrix product impossible, incompatible dimensions"))
> (<+ v1 (matrix-v M1)) (<+ v2 (matrix-v M2))
> (define (res i j) (<+ sum 0)
> (for ((<+ k 0) (< k p1) ($nfx$ k <- k + 1))
> ($nfx$ sum <- sum + (bracket-apply (bracket-apply v1 i) k) *
> (bracket-apply (bracket-apply v2 k) j)))
> (display "sum=") (display sum) (newline) sum)
> (<+ v (create-vector-2d res n1 p2)) (matrix v))
> (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
> (define (matrix-v M) (slot-ref M (quote v)))
> (define (vector->matrix-column v)
> (matrix (vector-map (lambda (x) (make-vector 1 x)) v)))
> (define (matrix-column->vector Mc) (<+ v (matrix-v Mc))
> (vector-map (lambda (v2) (bracket-apply v2 0)) v))
> (define (multiply-matrix-vector M v) (<+ Mc (vector->matrix-column v))
> (matrix-column->vector (multiply-matrix-matrix M Mc)))
> (define (matrix-ref M lin col) (<+ v (matrix-v M))
> (bracket-apply (bracket-apply v lin) col))
> (define (matrix-set! M lin col x) (<+ v (matrix-v M))
> (<- (bracket-apply (bracket-apply v lin) col) x))
> (define (matrix-line-ref M lin) (<+ v (matrix-v M)) (bracket-apply v lin))
> (define (matrix-line-set! M lin vect-line) (<+ v (matrix-v M))
> (<- (bracket-apply v lin) vect-line))
> (overload-square-brackets matrix-ref matrix-set! (matrix? number? number?))
> (overload-square-brackets matrix-line-ref matrix-line-set! (matrix? number?))
>
>
> overload-existing-operator redefine the * operator , so basically it
> needs the original one to not loose the * between numbers
> the code is:
>
> (define-syntax overload-existing-operator
>
> (syntax-rules ()
>
> ((_ orig-funct funct (pred-arg1 ...))
> (define orig-funct (create-overloaded-existing-operator
> orig-funct funct (list pred-arg1 ...))))))
>
> (define (create-overloaded-existing-operator orig-funct funct
> pred-list) ;; works for associative operators
>
> (display "create-overloaded-existing-operator")
> (display " : pred-list = ") (display pred-list) (newline)
> (define old-funct orig-funct)
> (define new-funct (lambda args ;; args is the list of arguments
> ;; (display "new-funct: new-funct = ") (display
> new-funct) (newline)
> ;; (display "new-funct : pred-list = ") (display
> pred-list) (newline)
> ;; (display "new-funct : args = ") (display args) (newline)
> (define nb-args (length args))
> ;;(display "new-funct : nb-args = ") (display nb-args) (newline)
> (cond ((check-arguments pred-list args) ;;(begin
> ;;(display "new funct :calling:")
> (display funct) (newline)
> (apply funct args));;)
> ((> nb-args 2) (new-funct (car args)
> (apply new-funct (cdr args)))) ;;
> op(a,b,...) = op(a,op(b,...))
> (else
> ;;(begin
> ;;(display "new funct :calling: ") (display
> old-funct) (newline)
> (apply old-funct args)))));;)
>
> (display "funct: ") (display funct) (newline)
> (display "orig-funct: ") (display orig-funct) (newline)
> (display "old-funct: ") (display old-funct) (newline)
> (display "new-funct: ") (display new-funct) (newline)
>
> (replace-operator! orig-funct new-funct)
>
> new-funct)
>
> this weird code return the new-funct which is the overloaded * , at
> the line (overload-existing-operator * multiply-matrix-matrix
> (matrix? matrix?))
>
> i got this error:
> Exception in thread "main" java.lang.ExceptionInInitializerError
> at atInteractiveLevel-8.run(exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa+.scm:43)
> at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
> at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> at kawa.Shell.run(Shell.java:289)
> at kawa.Shell.runFile(Shell.java:551)
> at kawa.standard.load.apply2(load.java:67)
> at kawa.standard.load.apply1(load.java:27)
> at gnu.mapping.Procedure1or2.applyToObject(Procedure1or2.java:64)
> at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75)
> at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
> at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
> at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> at kawa.Shell.run(Shell.java:289)
> at kawa.Shell.run(Shell.java:196)
> at kawa.Shell.run(Shell.java:183)
> at kawa.repl.processArgs(repl.java:724)
> at kawa.repl.main(repl.java:830)
> Caused by: /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/kawa/matrix.scm:9:10:
> unbound location: *
> at gnu.mapping.PlainLocation.get(PlainLocation.java:22)
> at matrix.<clinit>(matrix.scm:9)
> ... 17 more
>
> ok * seems not bound to any procedure
>
> when i display it for debug i got:
>
> multiply : * =%
>
> note that % is in reversed colors (white on black background) i cannot
> copy/paste it....
>
> all the code is called from a main file:
>
> (require matrix)
> (require array)
>
> (require Scheme+)
>
> it seems in a module * is not bound to anything, i had a same problem
> in Racket where i need to import racket/base, is there such a need in
> Kawa? ,i can find anything related in the doc.
>
> regards,
> damien
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: unbound location: *
2023-11-01 12:22 ` Damien Mattei
@ 2023-11-01 12:50 ` Damien Mattei
2023-11-01 14:02 ` Damien Mattei
2023-11-01 14:55 ` Per Bothner
1 sibling, 1 reply; 12+ messages in thread
From: Damien Mattei @ 2023-11-01 12:50 UTC (permalink / raw)
To: kawa mailing list
a simpler example that lead to the same error:
(module-name test-define)
(require Scheme+)
(export +)
; first stage overloading
(define-overload-existing-operator +)
; second stage overloading
(overload-existing-operator + vector-append (vector? vector?))
(display +) (newline)
a main file:
(require test-define)
(define rv (+ #(1 2) #(3 4 5)))
(newline) (display "rv=") (display rv) (newline)
result:
#|kawa:1|# (load
"/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/array.scm:89:6:
warning - void-valued expression where value is needed
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:15:10:
warning - no use of only-one?
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:18:10:
warning - no use of pair-list?
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:21:10:
warning - no use of empty?
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:54:10:
warning - no use of insertNoDups
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:61:10:
warning - no use of remove-duplicates
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:67:10:
warning - no use of singleton-list?
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:73:10:
warning - no use of create-list
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:88:10:
warning - no use of uniq
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:97:10:
warning - no use of remove-firsts-elements
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:115:10:
warning - no use of remove-last
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:157:10:
warning - no use of debut
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:162:10:
warning - no use of debut-iter
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:173:10:
warning - no use of not-list?
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:181:10:
warning - no use of before-element
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:189:10:
warning - no use of start-with-element
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:198:10:
warning - no use of pair-list-elements
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/overload.scm:399:10:
warning - no use of
find-getter-and-setter-for-overloaded-square-brackets
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/apply-square-brackets.scm:332:7:
warning - void-valued expression where value is needed
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/apply-square-brackets.scm:337:7:
warning - void-valued expression where value is needed
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/array.scm:
note - skipped 0 errors, 29 warnings, 0 notes
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/test-define.scm:13:29:
unbound location: +
at gnu.mapping.PlainLocation.get(PlainLocation.java:22)
at test-define.run(test-define.scm:13)
at gnu.expr.ModuleBody.run(ModuleBody.java:51)
at gnu.expr.ModuleBody.run(ModuleBody.java:35)
at atInteractiveLevel-2.run(main-test-define.scm:1)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
at kawa.Shell.run(Shell.java:289)
at kawa.Shell.runFile(Shell.java:551)
at kawa.standard.load.apply2(load.java:67)
at kawa.standard.load.apply1(load.java:27)
at gnu.mapping.Procedure1or2.applyToObject(Procedure1or2.java:64)
at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
at kawa.Shell.run(Shell.java:289)
at kawa.Shell.run(Shell.java:196)
at kawa.Shell.run(Shell.java:183)
at kawa.repl.processArgs(repl.java:724)
at kawa.repl.main(repl.java:830)
why + is unbound? in the worse case i should still have the default addition,no?
seems something is crashing in this code without any element to debug:
(define (create-overloaded-existing-operator orig-funct funct
pred-list) ;; works for associative operators
(display "create-overloaded-existing-operator")
(display " : pred-list = ") (display pred-list) (newline)
(define old-funct orig-funct)
(define new-funct (lambda args ;; args is the list of arguments
;; (display "new-funct: new-funct = ") (display
new-funct) (newline)
;; (display "new-funct : pred-list = ") (display
pred-list) (newline)
;; (display "new-funct : args = ") (display args) (newline)
(define nb-args (length args))
;;(display "new-funct : nb-args = ") (display nb-args) (newline)
(cond ((check-arguments pred-list args) ;;(begin
;;(display "new funct :calling:")
(display funct) (newline)
(apply funct args));;)
((> nb-args 2) (new-funct (car args)
(apply new-funct (cdr args)))) ;;
op(a,b,...) = op(a,op(b,...))
(else
;;(begin
;;(display "new funct :calling: ") (display
old-funct) (newline)
(apply old-funct args)))));;)
(display "funct: ") (display funct) (newline)
(display "orig-funct: ") (display orig-funct) (newline)
(display "old-funct: ") (display old-funct) (newline)
(display "new-funct: ") (display new-funct) (newline)
(replace-operator! orig-funct new-funct)
new-funct)
On Wed, Nov 1, 2023 at 1:22 PM Damien Mattei <damien.mattei@gmail.com> wrote:
>
> here is a counter example:
>
> ;; test-define.scm
>
> (module-name test-define)
>
> (export *)
>
> (display *) (newline)
>
> (define * +)
>
> (display *) (newline)
>
> ;; main-test-define.scm
>
> (require test-define)
>
> (define rv (* 2 3))
> (display rv) (newline)
>
> #|kawa:1|# (load
> "/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
> #<procedure +>
> #<procedure +>
> 5
>
> but i do not quite understand , first display shoud have display #<procedure *>
> but no it displays #<procedure +>
>
>
> On Wed, Nov 1, 2023 at 9:39 AM Damien Mattei <damien.mattei@gmail.com> wrote:
> >
> > hello,
> >
> > i created a module this way:
> >
> > (module-name "matrix")
> >
> > (export multiply-matrix-matrix
> > multiply-matrix-vector
> > matrix
> > matrix-v
> > create-matrix-by-function
> > dim-matrix
> > matrix-ref
> > matrix-set!
> > matrix-line-ref
> > matrix-line-set!
> > vector->matrix-column
> > matrix-column->vector
> > *)
> >
> > (require Scheme+)
> >
> >
> > ;; (matrix #(1 2 3))
> > ;; matrix@4612b856
> >
> >
> > (define-simple-class matrix ()
> >
> > (v :: vector)
> >
> > ((*init* (vParam :: vector))
> > (set! v vParam))
> >
> > )
> >
> > (display "multiply : * =") (display *) (newline)
> >
> >
> > ;; (define M (create-matrix-by-function (lambda (i j) (+ i j)) 2 3))
> > (define (create-matrix-by-function fct lin col)
> > (matrix (create-vector-2d fct lin col)))
> >
> >
> > ;; return the line and column values of dimension
> > ;; (dim-matrix M)
> > ;; 2 3
> > (define (dim-matrix M)
> >
> > (when (not (matrix? M))
> > (error "argument is not of type matrix"))
> >
> > {v <+ (matrix-v M)}
> > {lin <+ (vector-length v)}
> > {col <+ (vector-length {v[0]})}
> > (values lin col))
> >
> > ;; #|kawa:85|# (define M1 (create-matrix-by-function (lambda (i j) (+
> > i j)) 2 3))
> > ;; #|kawa:86|# (define M2 (create-matrix-by-function (lambda (i j) (+
> > i j)) 3 2))
> > ;; #|kawa:87|# (multiply-matrix-matrix M1 M2)
> > ;; matrix@3fc1abf
> > ;; #|kawa:88|# (define M1*M2 (multiply-matrix-matrix M1 M2))
> > ;; #|kawa:89|# M1*M2
> > ;; matrix@3bf5911d
> > ;; #|kawa:90|# (matrix-v M1*M2)
> > ;; #(#(5 8) #(8 14))
> > ;; #|kawa:91|# (matrix-v M1)
> > ;; #(#(0 1 2) #(1 2 3))
> > ;; #|kawa:92|# (matrix-v M2)
> > ;; #(#(0 1) #(1 2) #(2 3))
> > (define (multiply-matrix-matrix M1 M2)
> >
> > {(n1 p1) <+ (dim-matrix M1)}
> > {(n2 p2) <+ (dim-matrix M2)}
> >
> > (when {p1 ≠ n2} (error "matrix.* : matrix product impossible,
> > incompatible dimensions"))
> >
> > {v1 <+ (matrix-v M1)}
> > {v2 <+ (matrix-v M2)}
> >
> > (define (res i j)
> > {sum <+ 0}
> > (for ({k <+ 0} {k < p1} {k <- k + 1})
> > {sum <- sum + v1[i][k] * v2[k][j]})
> > (display "sum=")(display sum) (newline)
> > sum)
> >
> > {v <+ (create-vector-2d res n1 p2)}
> >
> > (matrix v))
> >
> >
> >
> > (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
> >
> >
> >
> > ....
> >
> > i cut off the whole code, the code used to works with 'include' , now
> > that i try with modules i stuck on this error at the line
> > (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
> >
> > note that matrix+.scm is converted externally in matrix.scm :
> >
> > (module-name "matrix")
> > (export multiply-matrix-matrix multiply-matrix-vector matrix matrix-v
> > create-matrix-by-function dim-matrix matrix-ref matrix-set! matrix-line-ref
> > matrix-line-set! vector->matrix-column matrix-column->vector *)
> > (require Scheme+)
> > (define-simple-class matrix () (v :: vector)
> > ((*init* (vParam :: vector)) (set! v vParam)))
> > (display "multiply : * =")
> > (display *)
> > (newline)
> > (define (create-matrix-by-function fct lin col)
> > (matrix (create-vector-2d fct lin col)))
> > (define (dim-matrix M)
> > (when (not (matrix? M)) (error "argument is not of type matrix"))
> > (<+ v (matrix-v M)) (<+ lin (vector-length v))
> > (<+ col (vector-length (bracket-apply v 0))) (values lin col))
> > (define (multiply-matrix-matrix M1 M2) (<+ (n1 p1) (dim-matrix M1))
> > (<+ (n2 p2) (dim-matrix M2))
> > (when (|≠| p1 n2)
> > (error "matrix.* : matrix product impossible, incompatible dimensions"))
> > (<+ v1 (matrix-v M1)) (<+ v2 (matrix-v M2))
> > (define (res i j) (<+ sum 0)
> > (for ((<+ k 0) (< k p1) ($nfx$ k <- k + 1))
> > ($nfx$ sum <- sum + (bracket-apply (bracket-apply v1 i) k) *
> > (bracket-apply (bracket-apply v2 k) j)))
> > (display "sum=") (display sum) (newline) sum)
> > (<+ v (create-vector-2d res n1 p2)) (matrix v))
> > (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
> > (define (matrix-v M) (slot-ref M (quote v)))
> > (define (vector->matrix-column v)
> > (matrix (vector-map (lambda (x) (make-vector 1 x)) v)))
> > (define (matrix-column->vector Mc) (<+ v (matrix-v Mc))
> > (vector-map (lambda (v2) (bracket-apply v2 0)) v))
> > (define (multiply-matrix-vector M v) (<+ Mc (vector->matrix-column v))
> > (matrix-column->vector (multiply-matrix-matrix M Mc)))
> > (define (matrix-ref M lin col) (<+ v (matrix-v M))
> > (bracket-apply (bracket-apply v lin) col))
> > (define (matrix-set! M lin col x) (<+ v (matrix-v M))
> > (<- (bracket-apply (bracket-apply v lin) col) x))
> > (define (matrix-line-ref M lin) (<+ v (matrix-v M)) (bracket-apply v lin))
> > (define (matrix-line-set! M lin vect-line) (<+ v (matrix-v M))
> > (<- (bracket-apply v lin) vect-line))
> > (overload-square-brackets matrix-ref matrix-set! (matrix? number? number?))
> > (overload-square-brackets matrix-line-ref matrix-line-set! (matrix? number?))
> >
> >
> > overload-existing-operator redefine the * operator , so basically it
> > needs the original one to not loose the * between numbers
> > the code is:
> >
> > (define-syntax overload-existing-operator
> >
> > (syntax-rules ()
> >
> > ((_ orig-funct funct (pred-arg1 ...))
> > (define orig-funct (create-overloaded-existing-operator
> > orig-funct funct (list pred-arg1 ...))))))
> >
> > (define (create-overloaded-existing-operator orig-funct funct
> > pred-list) ;; works for associative operators
> >
> > (display "create-overloaded-existing-operator")
> > (display " : pred-list = ") (display pred-list) (newline)
> > (define old-funct orig-funct)
> > (define new-funct (lambda args ;; args is the list of arguments
> > ;; (display "new-funct: new-funct = ") (display
> > new-funct) (newline)
> > ;; (display "new-funct : pred-list = ") (display
> > pred-list) (newline)
> > ;; (display "new-funct : args = ") (display args) (newline)
> > (define nb-args (length args))
> > ;;(display "new-funct : nb-args = ") (display nb-args) (newline)
> > (cond ((check-arguments pred-list args) ;;(begin
> > ;;(display "new funct :calling:")
> > (display funct) (newline)
> > (apply funct args));;)
> > ((> nb-args 2) (new-funct (car args)
> > (apply new-funct (cdr args)))) ;;
> > op(a,b,...) = op(a,op(b,...))
> > (else
> > ;;(begin
> > ;;(display "new funct :calling: ") (display
> > old-funct) (newline)
> > (apply old-funct args)))));;)
> >
> > (display "funct: ") (display funct) (newline)
> > (display "orig-funct: ") (display orig-funct) (newline)
> > (display "old-funct: ") (display old-funct) (newline)
> > (display "new-funct: ") (display new-funct) (newline)
> >
> > (replace-operator! orig-funct new-funct)
> >
> > new-funct)
> >
> > this weird code return the new-funct which is the overloaded * , at
> > the line (overload-existing-operator * multiply-matrix-matrix
> > (matrix? matrix?))
> >
> > i got this error:
> > Exception in thread "main" java.lang.ExceptionInInitializerError
> > at atInteractiveLevel-8.run(exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa+.scm:43)
> > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
> > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> > at kawa.Shell.run(Shell.java:289)
> > at kawa.Shell.runFile(Shell.java:551)
> > at kawa.standard.load.apply2(load.java:67)
> > at kawa.standard.load.apply1(load.java:27)
> > at gnu.mapping.Procedure1or2.applyToObject(Procedure1or2.java:64)
> > at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75)
> > at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
> > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
> > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> > at kawa.Shell.run(Shell.java:289)
> > at kawa.Shell.run(Shell.java:196)
> > at kawa.Shell.run(Shell.java:183)
> > at kawa.repl.processArgs(repl.java:724)
> > at kawa.repl.main(repl.java:830)
> > Caused by: /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/kawa/matrix.scm:9:10:
> > unbound location: *
> > at gnu.mapping.PlainLocation.get(PlainLocation.java:22)
> > at matrix.<clinit>(matrix.scm:9)
> > ... 17 more
> >
> > ok * seems not bound to any procedure
> >
> > when i display it for debug i got:
> >
> > multiply : * =%
> >
> > note that % is in reversed colors (white on black background) i cannot
> > copy/paste it....
> >
> > all the code is called from a main file:
> >
> > (require matrix)
> > (require array)
> >
> > (require Scheme+)
> >
> > it seems in a module * is not bound to anything, i had a same problem
> > in Racket where i need to import racket/base, is there such a need in
> > Kawa? ,i can find anything related in the doc.
> >
> > regards,
> > damien
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: unbound location: *
2023-11-01 12:50 ` Damien Mattei
@ 2023-11-01 14:02 ` Damien Mattei
2023-11-01 16:11 ` Damien Mattei
0 siblings, 1 reply; 12+ messages in thread
From: Damien Mattei @ 2023-11-01 14:02 UTC (permalink / raw)
To: kawa mailing list
[-- Attachment #1: Type: text/plain, Size: 21213 bytes --]
i post a version of my problem independent to Scheme+.
in two attached files containing this kawa code code:
(module-name test-define)
(require 'srfi-1)
(export +)
(define (check-arguments pred-list args)
(if (= (length pred-list) (length args))
(let ((pred-arg-list (map cons pred-list args)))
;;(andmap (lambda (p) ((car p) (cdr p)))
;; replace andmap with every in Guile
(every (lambda (p) ((car p) (cdr p)))
pred-arg-list))
#f))
(define (create-overloaded-existing-operator orig-funct funct
pred-list) ;; works for associative operators
(display "create-overloaded-existing-operator")
(display " : pred-list = ") (display pred-list) (newline)
(define old-funct orig-funct)
(define new-funct (lambda args ;; args is the list of arguments
;; (display "new-funct: new-funct = ") (display
new-funct) (newline)
;; (display "new-funct : pred-list = ") (display
pred-list) (newline)
;; (display "new-funct : args = ") (display args) (newline)
(define nb-args (length args))
;;(display "new-funct : nb-args = ") (display nb-args) (newline)
(cond ((check-arguments pred-list args) ;;(begin
;;(display "new funct :calling:")
(display funct) (newline)
(apply funct args));;)
((> nb-args 2) (new-funct (car args)
(apply new-funct (cdr args)))) ;;
op(a,b,...) = op(a,op(b,...))
(else
;;(begin
;;(display "new funct :calling: ") (display
old-funct) (newline)
(apply old-funct args)))));;)
(display "funct: ") (display funct) (newline)
(display "orig-funct: ") (display orig-funct) (newline)
(display "old-funct: ") (display old-funct) (newline)
(display "new-funct: ") (display new-funct) (newline)
;;(replace-operator! orig-funct new-funct)
new-funct)
(define-syntax overload-existing-operator
(syntax-rules ()
((_ orig-funct funct (pred-arg1 ...))
(define orig-funct (create-overloaded-existing-operator
orig-funct funct (list pred-arg1 ...))))))
; first stage overloading
;;(define-overload-existing-operator +) ;; dummy in this implementation
; second stage overloading
(overload-existing-operator + vector-append (vector? vector?))
(display +) (newline)
and a simple main:
(require test-define)
(define rv (+ #(1 2) #(3 4 5)))
(newline) (display "rv=") (display rv) (newline)
i load it this way:
kawa -Dkawa.import.path=".:/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa:./kawa"
(load "/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
#|kawa:1|# (load
"/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/test-define.scm:63:29:
unbound location: +
at gnu.mapping.PlainLocation.get(PlainLocation.java:22)
at test-define.run(test-define.scm:63)
at gnu.expr.ModuleBody.run(ModuleBody.java:51)
at gnu.expr.ModuleBody.run(ModuleBody.java:35)
at atInteractiveLevel-2.run(main-test-define.scm:1)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
at kawa.Shell.run(Shell.java:289)
at kawa.Shell.runFile(Shell.java:551)
at kawa.standard.load.apply2(load.java:67)
at kawa.standard.load.apply1(load.java:27)
at gnu.mapping.Procedure1or2.applyToObject(Procedure1or2.java:64)
at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
at kawa.Shell.run(Shell.java:289)
at kawa.Shell.run(Shell.java:196)
at kawa.Shell.run(Shell.java:183)
at kawa.repl.processArgs(repl.java:724)
at kawa.repl.main(repl.java:830)
On Wed, Nov 1, 2023 at 1:50 PM Damien Mattei <damien.mattei@gmail.com> wrote:
>
> a simpler example that lead to the same error:
>
> (module-name test-define)
>
> (require Scheme+)
>
> (export +)
>
> ; first stage overloading
> (define-overload-existing-operator +)
>
>
>
> ; second stage overloading
> (overload-existing-operator + vector-append (vector? vector?))
>
>
> (display +) (newline)
>
>
> a main file:
>
> (require test-define)
>
> (define rv (+ #(1 2) #(3 4 5)))
> (newline) (display "rv=") (display rv) (newline)
>
> result:
> #|kawa:1|# (load
> "/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/array.scm:89:6:
> warning - void-valued expression where value is needed
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:15:10:
> warning - no use of only-one?
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:18:10:
> warning - no use of pair-list?
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:21:10:
> warning - no use of empty?
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:54:10:
> warning - no use of insertNoDups
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:61:10:
> warning - no use of remove-duplicates
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:67:10:
> warning - no use of singleton-list?
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:73:10:
> warning - no use of create-list
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:88:10:
> warning - no use of uniq
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:97:10:
> warning - no use of remove-firsts-elements
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:115:10:
> warning - no use of remove-last
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:157:10:
> warning - no use of debut
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:162:10:
> warning - no use of debut-iter
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:173:10:
> warning - no use of not-list?
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:181:10:
> warning - no use of before-element
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:189:10:
> warning - no use of start-with-element
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:198:10:
> warning - no use of pair-list-elements
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/overload.scm:399:10:
> warning - no use of
> find-getter-and-setter-for-overloaded-square-brackets
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/apply-square-brackets.scm:332:7:
> warning - void-valued expression where value is needed
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/apply-square-brackets.scm:337:7:
> warning - void-valued expression where value is needed
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/array.scm:
> note - skipped 0 errors, 29 warnings, 0 notes
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/test-define.scm:13:29:
> unbound location: +
> at gnu.mapping.PlainLocation.get(PlainLocation.java:22)
> at test-define.run(test-define.scm:13)
> at gnu.expr.ModuleBody.run(ModuleBody.java:51)
> at gnu.expr.ModuleBody.run(ModuleBody.java:35)
> at atInteractiveLevel-2.run(main-test-define.scm:1)
> at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
> at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> at kawa.Shell.run(Shell.java:289)
> at kawa.Shell.runFile(Shell.java:551)
> at kawa.standard.load.apply2(load.java:67)
> at kawa.standard.load.apply1(load.java:27)
> at gnu.mapping.Procedure1or2.applyToObject(Procedure1or2.java:64)
> at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75)
> at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
> at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
> at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> at kawa.Shell.run(Shell.java:289)
> at kawa.Shell.run(Shell.java:196)
> at kawa.Shell.run(Shell.java:183)
> at kawa.repl.processArgs(repl.java:724)
> at kawa.repl.main(repl.java:830)
>
> why + is unbound? in the worse case i should still have the default addition,no?
>
> seems something is crashing in this code without any element to debug:
> (define (create-overloaded-existing-operator orig-funct funct
> pred-list) ;; works for associative operators
>
> (display "create-overloaded-existing-operator")
> (display " : pred-list = ") (display pred-list) (newline)
> (define old-funct orig-funct)
> (define new-funct (lambda args ;; args is the list of arguments
> ;; (display "new-funct: new-funct = ") (display
> new-funct) (newline)
> ;; (display "new-funct : pred-list = ") (display
> pred-list) (newline)
> ;; (display "new-funct : args = ") (display args) (newline)
> (define nb-args (length args))
> ;;(display "new-funct : nb-args = ") (display nb-args) (newline)
> (cond ((check-arguments pred-list args) ;;(begin
> ;;(display "new funct :calling:")
> (display funct) (newline)
> (apply funct args));;)
> ((> nb-args 2) (new-funct (car args)
> (apply new-funct (cdr args)))) ;;
> op(a,b,...) = op(a,op(b,...))
> (else
> ;;(begin
> ;;(display "new funct :calling: ") (display
> old-funct) (newline)
> (apply old-funct args)))));;)
>
> (display "funct: ") (display funct) (newline)
> (display "orig-funct: ") (display orig-funct) (newline)
> (display "old-funct: ") (display old-funct) (newline)
> (display "new-funct: ") (display new-funct) (newline)
>
> (replace-operator! orig-funct new-funct)
>
> new-funct)
>
> On Wed, Nov 1, 2023 at 1:22 PM Damien Mattei <damien.mattei@gmail.com> wrote:
> >
> > here is a counter example:
> >
> > ;; test-define.scm
> >
> > (module-name test-define)
> >
> > (export *)
> >
> > (display *) (newline)
> >
> > (define * +)
> >
> > (display *) (newline)
> >
> > ;; main-test-define.scm
> >
> > (require test-define)
> >
> > (define rv (* 2 3))
> > (display rv) (newline)
> >
> > #|kawa:1|# (load
> > "/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
> > #<procedure +>
> > #<procedure +>
> > 5
> >
> > but i do not quite understand , first display shoud have display #<procedure *>
> > but no it displays #<procedure +>
> >
> >
> > On Wed, Nov 1, 2023 at 9:39 AM Damien Mattei <damien.mattei@gmail.com> wrote:
> > >
> > > hello,
> > >
> > > i created a module this way:
> > >
> > > (module-name "matrix")
> > >
> > > (export multiply-matrix-matrix
> > > multiply-matrix-vector
> > > matrix
> > > matrix-v
> > > create-matrix-by-function
> > > dim-matrix
> > > matrix-ref
> > > matrix-set!
> > > matrix-line-ref
> > > matrix-line-set!
> > > vector->matrix-column
> > > matrix-column->vector
> > > *)
> > >
> > > (require Scheme+)
> > >
> > >
> > > ;; (matrix #(1 2 3))
> > > ;; matrix@4612b856
> > >
> > >
> > > (define-simple-class matrix ()
> > >
> > > (v :: vector)
> > >
> > > ((*init* (vParam :: vector))
> > > (set! v vParam))
> > >
> > > )
> > >
> > > (display "multiply : * =") (display *) (newline)
> > >
> > >
> > > ;; (define M (create-matrix-by-function (lambda (i j) (+ i j)) 2 3))
> > > (define (create-matrix-by-function fct lin col)
> > > (matrix (create-vector-2d fct lin col)))
> > >
> > >
> > > ;; return the line and column values of dimension
> > > ;; (dim-matrix M)
> > > ;; 2 3
> > > (define (dim-matrix M)
> > >
> > > (when (not (matrix? M))
> > > (error "argument is not of type matrix"))
> > >
> > > {v <+ (matrix-v M)}
> > > {lin <+ (vector-length v)}
> > > {col <+ (vector-length {v[0]})}
> > > (values lin col))
> > >
> > > ;; #|kawa:85|# (define M1 (create-matrix-by-function (lambda (i j) (+
> > > i j)) 2 3))
> > > ;; #|kawa:86|# (define M2 (create-matrix-by-function (lambda (i j) (+
> > > i j)) 3 2))
> > > ;; #|kawa:87|# (multiply-matrix-matrix M1 M2)
> > > ;; matrix@3fc1abf
> > > ;; #|kawa:88|# (define M1*M2 (multiply-matrix-matrix M1 M2))
> > > ;; #|kawa:89|# M1*M2
> > > ;; matrix@3bf5911d
> > > ;; #|kawa:90|# (matrix-v M1*M2)
> > > ;; #(#(5 8) #(8 14))
> > > ;; #|kawa:91|# (matrix-v M1)
> > > ;; #(#(0 1 2) #(1 2 3))
> > > ;; #|kawa:92|# (matrix-v M2)
> > > ;; #(#(0 1) #(1 2) #(2 3))
> > > (define (multiply-matrix-matrix M1 M2)
> > >
> > > {(n1 p1) <+ (dim-matrix M1)}
> > > {(n2 p2) <+ (dim-matrix M2)}
> > >
> > > (when {p1 ≠ n2} (error "matrix.* : matrix product impossible,
> > > incompatible dimensions"))
> > >
> > > {v1 <+ (matrix-v M1)}
> > > {v2 <+ (matrix-v M2)}
> > >
> > > (define (res i j)
> > > {sum <+ 0}
> > > (for ({k <+ 0} {k < p1} {k <- k + 1})
> > > {sum <- sum + v1[i][k] * v2[k][j]})
> > > (display "sum=")(display sum) (newline)
> > > sum)
> > >
> > > {v <+ (create-vector-2d res n1 p2)}
> > >
> > > (matrix v))
> > >
> > >
> > >
> > > (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
> > >
> > >
> > >
> > > ....
> > >
> > > i cut off the whole code, the code used to works with 'include' , now
> > > that i try with modules i stuck on this error at the line
> > > (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
> > >
> > > note that matrix+.scm is converted externally in matrix.scm :
> > >
> > > (module-name "matrix")
> > > (export multiply-matrix-matrix multiply-matrix-vector matrix matrix-v
> > > create-matrix-by-function dim-matrix matrix-ref matrix-set! matrix-line-ref
> > > matrix-line-set! vector->matrix-column matrix-column->vector *)
> > > (require Scheme+)
> > > (define-simple-class matrix () (v :: vector)
> > > ((*init* (vParam :: vector)) (set! v vParam)))
> > > (display "multiply : * =")
> > > (display *)
> > > (newline)
> > > (define (create-matrix-by-function fct lin col)
> > > (matrix (create-vector-2d fct lin col)))
> > > (define (dim-matrix M)
> > > (when (not (matrix? M)) (error "argument is not of type matrix"))
> > > (<+ v (matrix-v M)) (<+ lin (vector-length v))
> > > (<+ col (vector-length (bracket-apply v 0))) (values lin col))
> > > (define (multiply-matrix-matrix M1 M2) (<+ (n1 p1) (dim-matrix M1))
> > > (<+ (n2 p2) (dim-matrix M2))
> > > (when (|≠| p1 n2)
> > > (error "matrix.* : matrix product impossible, incompatible dimensions"))
> > > (<+ v1 (matrix-v M1)) (<+ v2 (matrix-v M2))
> > > (define (res i j) (<+ sum 0)
> > > (for ((<+ k 0) (< k p1) ($nfx$ k <- k + 1))
> > > ($nfx$ sum <- sum + (bracket-apply (bracket-apply v1 i) k) *
> > > (bracket-apply (bracket-apply v2 k) j)))
> > > (display "sum=") (display sum) (newline) sum)
> > > (<+ v (create-vector-2d res n1 p2)) (matrix v))
> > > (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
> > > (define (matrix-v M) (slot-ref M (quote v)))
> > > (define (vector->matrix-column v)
> > > (matrix (vector-map (lambda (x) (make-vector 1 x)) v)))
> > > (define (matrix-column->vector Mc) (<+ v (matrix-v Mc))
> > > (vector-map (lambda (v2) (bracket-apply v2 0)) v))
> > > (define (multiply-matrix-vector M v) (<+ Mc (vector->matrix-column v))
> > > (matrix-column->vector (multiply-matrix-matrix M Mc)))
> > > (define (matrix-ref M lin col) (<+ v (matrix-v M))
> > > (bracket-apply (bracket-apply v lin) col))
> > > (define (matrix-set! M lin col x) (<+ v (matrix-v M))
> > > (<- (bracket-apply (bracket-apply v lin) col) x))
> > > (define (matrix-line-ref M lin) (<+ v (matrix-v M)) (bracket-apply v lin))
> > > (define (matrix-line-set! M lin vect-line) (<+ v (matrix-v M))
> > > (<- (bracket-apply v lin) vect-line))
> > > (overload-square-brackets matrix-ref matrix-set! (matrix? number? number?))
> > > (overload-square-brackets matrix-line-ref matrix-line-set! (matrix? number?))
> > >
> > >
> > > overload-existing-operator redefine the * operator , so basically it
> > > needs the original one to not loose the * between numbers
> > > the code is:
> > >
> > > (define-syntax overload-existing-operator
> > >
> > > (syntax-rules ()
> > >
> > > ((_ orig-funct funct (pred-arg1 ...))
> > > (define orig-funct (create-overloaded-existing-operator
> > > orig-funct funct (list pred-arg1 ...))))))
> > >
> > > (define (create-overloaded-existing-operator orig-funct funct
> > > pred-list) ;; works for associative operators
> > >
> > > (display "create-overloaded-existing-operator")
> > > (display " : pred-list = ") (display pred-list) (newline)
> > > (define old-funct orig-funct)
> > > (define new-funct (lambda args ;; args is the list of arguments
> > > ;; (display "new-funct: new-funct = ") (display
> > > new-funct) (newline)
> > > ;; (display "new-funct : pred-list = ") (display
> > > pred-list) (newline)
> > > ;; (display "new-funct : args = ") (display args) (newline)
> > > (define nb-args (length args))
> > > ;;(display "new-funct : nb-args = ") (display nb-args) (newline)
> > > (cond ((check-arguments pred-list args) ;;(begin
> > > ;;(display "new funct :calling:")
> > > (display funct) (newline)
> > > (apply funct args));;)
> > > ((> nb-args 2) (new-funct (car args)
> > > (apply new-funct (cdr args)))) ;;
> > > op(a,b,...) = op(a,op(b,...))
> > > (else
> > > ;;(begin
> > > ;;(display "new funct :calling: ") (display
> > > old-funct) (newline)
> > > (apply old-funct args)))));;)
> > >
> > > (display "funct: ") (display funct) (newline)
> > > (display "orig-funct: ") (display orig-funct) (newline)
> > > (display "old-funct: ") (display old-funct) (newline)
> > > (display "new-funct: ") (display new-funct) (newline)
> > >
> > > (replace-operator! orig-funct new-funct)
> > >
> > > new-funct)
> > >
> > > this weird code return the new-funct which is the overloaded * , at
> > > the line (overload-existing-operator * multiply-matrix-matrix
> > > (matrix? matrix?))
> > >
> > > i got this error:
> > > Exception in thread "main" java.lang.ExceptionInInitializerError
> > > at atInteractiveLevel-8.run(exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa+.scm:43)
> > > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
> > > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> > > at kawa.Shell.run(Shell.java:289)
> > > at kawa.Shell.runFile(Shell.java:551)
> > > at kawa.standard.load.apply2(load.java:67)
> > > at kawa.standard.load.apply1(load.java:27)
> > > at gnu.mapping.Procedure1or2.applyToObject(Procedure1or2.java:64)
> > > at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75)
> > > at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
> > > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
> > > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> > > at kawa.Shell.run(Shell.java:289)
> > > at kawa.Shell.run(Shell.java:196)
> > > at kawa.Shell.run(Shell.java:183)
> > > at kawa.repl.processArgs(repl.java:724)
> > > at kawa.repl.main(repl.java:830)
> > > Caused by: /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/kawa/matrix.scm:9:10:
> > > unbound location: *
> > > at gnu.mapping.PlainLocation.get(PlainLocation.java:22)
> > > at matrix.<clinit>(matrix.scm:9)
> > > ... 17 more
> > >
> > > ok * seems not bound to any procedure
> > >
> > > when i display it for debug i got:
> > >
> > > multiply : * =%
> > >
> > > note that % is in reversed colors (white on black background) i cannot
> > > copy/paste it....
> > >
> > > all the code is called from a main file:
> > >
> > > (require matrix)
> > > (require array)
> > >
> > > (require Scheme+)
> > >
> > > it seems in a module * is not bound to anything, i had a same problem
> > > in Racket where i need to import racket/base, is there such a need in
> > > Kawa? ,i can find anything related in the doc.
> > >
> > > regards,
> > > damien
[-- Attachment #2: test-define.scm --]
[-- Type: application/octet-stream, Size: 2148 bytes --]
(module-name test-define)
(require 'srfi-1)
(export +)
(define (check-arguments pred-list args)
(if (= (length pred-list) (length args))
(let ((pred-arg-list (map cons pred-list args)))
;;(andmap (lambda (p) ((car p) (cdr p)))
;; replace andmap with every in Guile
(every (lambda (p) ((car p) (cdr p)))
pred-arg-list))
#f))
(define (create-overloaded-existing-operator orig-funct funct pred-list) ;; works for associative operators
(display "create-overloaded-existing-operator")
(display " : pred-list = ") (display pred-list) (newline)
(define old-funct orig-funct)
(define new-funct (lambda args ;; args is the list of arguments
;; (display "new-funct: new-funct = ") (display new-funct) (newline)
;; (display "new-funct : pred-list = ") (display pred-list) (newline)
;; (display "new-funct : args = ") (display args) (newline)
(define nb-args (length args))
;;(display "new-funct : nb-args = ") (display nb-args) (newline)
(cond ((check-arguments pred-list args) ;;(begin
;;(display "new funct :calling:") (display funct) (newline)
(apply funct args));;)
((> nb-args 2) (new-funct (car args)
(apply new-funct (cdr args)))) ;; op(a,b,...) = op(a,op(b,...))
(else
;;(begin
;;(display "new funct :calling: ") (display old-funct) (newline)
(apply old-funct args)))));;)
(display "funct: ") (display funct) (newline)
(display "orig-funct: ") (display orig-funct) (newline)
(display "old-funct: ") (display old-funct) (newline)
(display "new-funct: ") (display new-funct) (newline)
;;(replace-operator! orig-funct new-funct)
new-funct)
(define-syntax overload-existing-operator
(syntax-rules ()
((_ orig-funct funct (pred-arg1 ...))
(define orig-funct (create-overloaded-existing-operator orig-funct funct (list pred-arg1 ...))))))
; first stage overloading
;;(define-overload-existing-operator +) ;; dummy in this implementation
; second stage overloading
(overload-existing-operator + vector-append (vector? vector?))
(display +) (newline)
[-- Attachment #3: main-test-define.scm --]
[-- Type: application/octet-stream, Size: 105 bytes --]
(require test-define)
(define rv (+ #(1 2) #(3 4 5)))
(newline) (display "rv=") (display rv) (newline)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: unbound location: *
2023-11-01 12:22 ` Damien Mattei
2023-11-01 12:50 ` Damien Mattei
@ 2023-11-01 14:55 ` Per Bothner
1 sibling, 0 replies; 12+ messages in thread
From: Per Bothner @ 2023-11-01 14:55 UTC (permalink / raw)
To: Damien Mattei, kawa mailing list
On 11/1/23 05:22, Damien Mattei via Kawa wrote:
> here is a counter example:
>
> ;; test-define.scm
>
> (module-name test-define)
>
> (export *)
>
> (display *) (newline)
>
> (define * +)
>
> (display *) (newline)
>
> ;; main-test-define.scm
>
> (require test-define)
>
> (define rv (* 2 3))
> (display rv) (newline)
>
> #|kawa:1|# (load
> "/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
> #<procedure +>
> #<procedure +>
> 5
>
> but i do not quite understand , first display shoud have display #<procedure *>
> but no it displays #<procedure +>
'define' is not an assignment. If there is a define in a module, that is the definition - any
other definition is not visible.
Now in some cases if you try to reference a definition before it has been given a value,
you might get an error or some kind of null/undefined value. However, it this particular
case it seems to work.
If you want the sort of dynamic definition you're expecting,
you can try define-variable.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: unbound location: *
2023-11-01 14:02 ` Damien Mattei
@ 2023-11-01 16:11 ` Damien Mattei
2023-11-01 16:47 ` Damien Mattei
0 siblings, 1 reply; 12+ messages in thread
From: Damien Mattei @ 2023-11-01 16:11 UTC (permalink / raw)
To: kawa mailing list, Per Bothner
if i modify a bit this version with define-variable instead of
define, it seems to go further as i got an infinite loop:
#|kawa:1|# (load
"/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
Exception in thread "main" java.lang.StackOverflowError
at java.base/java.lang.ThreadLocal.get(ThreadLocal.java:172)
at gnu.mapping.Environment.getCurrent(Environment.java:373)
at gnu.mapping.DynamicLocation.lookup(DynamicLocation.java:28)
at gnu.mapping.DynamicLocation.isBound(DynamicLocation.java:46)
at gnu.kawa.reflect.FieldLocation.isBound(FieldLocation.java:360)
at gnu.mapping.SharedLocation.isBound(SharedLocation.java:34)
at gnu.mapping.InheritingEnvironment.getLocation(InheritingEnvironment.java:71)
at gnu.mapping.DynamicLocation.lookup(DynamicLocation.java:29)
at gnu.mapping.DynamicLocation.isBound(DynamicLocation.java:46)
at gnu.kawa.reflect.FieldLocation.isBound(FieldLocation.java:360)
at gnu.mapping.SharedLocation.isBound(SharedLocation.java:34)
at gnu.mapping.InheritingEnvironment.getLocation(InheritingEnvironment.java:71)
at gnu.mapping.DynamicLocation.lookup(DynamicLocation.java:29)
at gnu.mapping.DynamicLocation.isBound(DynamicLocation.java:46)
at gnu.kawa.reflect.FieldLocation.isBound(FieldLocation.java:360)
at gnu.mapping.SharedLocation.isBound(SharedLocation.java:34)
at gnu.mapping.InheritingEnvironment.getLocation(InheritingEnvironment.java:71)
at gn
....
On Wed, Nov 1, 2023 at 3:02 PM Damien Mattei <damien.mattei@gmail.com> wrote:
>
> i post a version of my problem independent to Scheme+.
> in two attached files containing this kawa code code:
> (module-name test-define)
>
> (require 'srfi-1)
>
> (export +)
>
>
> (define (check-arguments pred-list args)
> (if (= (length pred-list) (length args))
> (let ((pred-arg-list (map cons pred-list args)))
> ;;(andmap (lambda (p) ((car p) (cdr p)))
> ;; replace andmap with every in Guile
> (every (lambda (p) ((car p) (cdr p)))
> pred-arg-list))
> #f))
>
>
> (define (create-overloaded-existing-operator orig-funct funct
> pred-list) ;; works for associative operators
>
> (display "create-overloaded-existing-operator")
> (display " : pred-list = ") (display pred-list) (newline)
> (define old-funct orig-funct)
> (define new-funct (lambda args ;; args is the list of arguments
> ;; (display "new-funct: new-funct = ") (display
> new-funct) (newline)
> ;; (display "new-funct : pred-list = ") (display
> pred-list) (newline)
> ;; (display "new-funct : args = ") (display args) (newline)
> (define nb-args (length args))
> ;;(display "new-funct : nb-args = ") (display nb-args) (newline)
> (cond ((check-arguments pred-list args) ;;(begin
> ;;(display "new funct :calling:")
> (display funct) (newline)
> (apply funct args));;)
> ((> nb-args 2) (new-funct (car args)
> (apply new-funct (cdr args)))) ;;
> op(a,b,...) = op(a,op(b,...))
> (else
> ;;(begin
> ;;(display "new funct :calling: ") (display
> old-funct) (newline)
> (apply old-funct args)))));;)
>
> (display "funct: ") (display funct) (newline)
> (display "orig-funct: ") (display orig-funct) (newline)
> (display "old-funct: ") (display old-funct) (newline)
> (display "new-funct: ") (display new-funct) (newline)
>
> ;;(replace-operator! orig-funct new-funct)
>
> new-funct)
>
> (define-syntax overload-existing-operator
>
> (syntax-rules ()
>
> ((_ orig-funct funct (pred-arg1 ...))
> (define orig-funct (create-overloaded-existing-operator
> orig-funct funct (list pred-arg1 ...))))))
>
>
>
> ; first stage overloading
> ;;(define-overload-existing-operator +) ;; dummy in this implementation
>
>
>
> ; second stage overloading
> (overload-existing-operator + vector-append (vector? vector?))
>
>
> (display +) (newline)
>
>
>
> and a simple main:
> (require test-define)
>
> (define rv (+ #(1 2) #(3 4 5)))
> (newline) (display "rv=") (display rv) (newline)
>
> i load it this way:
>
> kawa -Dkawa.import.path=".:/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa:./kawa"
>
> (load "/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
>
> #|kawa:1|# (load
> "/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
> /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/test-define.scm:63:29:
> unbound location: +
> at gnu.mapping.PlainLocation.get(PlainLocation.java:22)
> at test-define.run(test-define.scm:63)
> at gnu.expr.ModuleBody.run(ModuleBody.java:51)
> at gnu.expr.ModuleBody.run(ModuleBody.java:35)
> at atInteractiveLevel-2.run(main-test-define.scm:1)
> at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
> at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> at kawa.Shell.run(Shell.java:289)
> at kawa.Shell.runFile(Shell.java:551)
> at kawa.standard.load.apply2(load.java:67)
> at kawa.standard.load.apply1(load.java:27)
> at gnu.mapping.Procedure1or2.applyToObject(Procedure1or2.java:64)
> at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75)
> at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
> at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
> at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> at kawa.Shell.run(Shell.java:289)
> at kawa.Shell.run(Shell.java:196)
> at kawa.Shell.run(Shell.java:183)
> at kawa.repl.processArgs(repl.java:724)
> at kawa.repl.main(repl.java:830)
>
> On Wed, Nov 1, 2023 at 1:50 PM Damien Mattei <damien.mattei@gmail.com> wrote:
> >
> > a simpler example that lead to the same error:
> >
> > (module-name test-define)
> >
> > (require Scheme+)
> >
> > (export +)
> >
> > ; first stage overloading
> > (define-overload-existing-operator +)
> >
> >
> >
> > ; second stage overloading
> > (overload-existing-operator + vector-append (vector? vector?))
> >
> >
> > (display +) (newline)
> >
> >
> > a main file:
> >
> > (require test-define)
> >
> > (define rv (+ #(1 2) #(3 4 5)))
> > (newline) (display "rv=") (display rv) (newline)
> >
> > result:
> > #|kawa:1|# (load
> > "/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/array.scm:89:6:
> > warning - void-valued expression where value is needed
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:15:10:
> > warning - no use of only-one?
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:18:10:
> > warning - no use of pair-list?
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:21:10:
> > warning - no use of empty?
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:54:10:
> > warning - no use of insertNoDups
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:61:10:
> > warning - no use of remove-duplicates
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:67:10:
> > warning - no use of singleton-list?
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:73:10:
> > warning - no use of create-list
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:88:10:
> > warning - no use of uniq
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:97:10:
> > warning - no use of remove-firsts-elements
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:115:10:
> > warning - no use of remove-last
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:157:10:
> > warning - no use of debut
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:162:10:
> > warning - no use of debut-iter
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:173:10:
> > warning - no use of not-list?
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:181:10:
> > warning - no use of before-element
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:189:10:
> > warning - no use of start-with-element
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:198:10:
> > warning - no use of pair-list-elements
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/overload.scm:399:10:
> > warning - no use of
> > find-getter-and-setter-for-overloaded-square-brackets
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/apply-square-brackets.scm:332:7:
> > warning - void-valued expression where value is needed
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/apply-square-brackets.scm:337:7:
> > warning - void-valued expression where value is needed
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/array.scm:
> > note - skipped 0 errors, 29 warnings, 0 notes
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/test-define.scm:13:29:
> > unbound location: +
> > at gnu.mapping.PlainLocation.get(PlainLocation.java:22)
> > at test-define.run(test-define.scm:13)
> > at gnu.expr.ModuleBody.run(ModuleBody.java:51)
> > at gnu.expr.ModuleBody.run(ModuleBody.java:35)
> > at atInteractiveLevel-2.run(main-test-define.scm:1)
> > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
> > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> > at kawa.Shell.run(Shell.java:289)
> > at kawa.Shell.runFile(Shell.java:551)
> > at kawa.standard.load.apply2(load.java:67)
> > at kawa.standard.load.apply1(load.java:27)
> > at gnu.mapping.Procedure1or2.applyToObject(Procedure1or2.java:64)
> > at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75)
> > at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
> > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
> > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> > at kawa.Shell.run(Shell.java:289)
> > at kawa.Shell.run(Shell.java:196)
> > at kawa.Shell.run(Shell.java:183)
> > at kawa.repl.processArgs(repl.java:724)
> > at kawa.repl.main(repl.java:830)
> >
> > why + is unbound? in the worse case i should still have the default addition,no?
> >
> > seems something is crashing in this code without any element to debug:
> > (define (create-overloaded-existing-operator orig-funct funct
> > pred-list) ;; works for associative operators
> >
> > (display "create-overloaded-existing-operator")
> > (display " : pred-list = ") (display pred-list) (newline)
> > (define old-funct orig-funct)
> > (define new-funct (lambda args ;; args is the list of arguments
> > ;; (display "new-funct: new-funct = ") (display
> > new-funct) (newline)
> > ;; (display "new-funct : pred-list = ") (display
> > pred-list) (newline)
> > ;; (display "new-funct : args = ") (display args) (newline)
> > (define nb-args (length args))
> > ;;(display "new-funct : nb-args = ") (display nb-args) (newline)
> > (cond ((check-arguments pred-list args) ;;(begin
> > ;;(display "new funct :calling:")
> > (display funct) (newline)
> > (apply funct args));;)
> > ((> nb-args 2) (new-funct (car args)
> > (apply new-funct (cdr args)))) ;;
> > op(a,b,...) = op(a,op(b,...))
> > (else
> > ;;(begin
> > ;;(display "new funct :calling: ") (display
> > old-funct) (newline)
> > (apply old-funct args)))));;)
> >
> > (display "funct: ") (display funct) (newline)
> > (display "orig-funct: ") (display orig-funct) (newline)
> > (display "old-funct: ") (display old-funct) (newline)
> > (display "new-funct: ") (display new-funct) (newline)
> >
> > (replace-operator! orig-funct new-funct)
> >
> > new-funct)
> >
> > On Wed, Nov 1, 2023 at 1:22 PM Damien Mattei <damien.mattei@gmail.com> wrote:
> > >
> > > here is a counter example:
> > >
> > > ;; test-define.scm
> > >
> > > (module-name test-define)
> > >
> > > (export *)
> > >
> > > (display *) (newline)
> > >
> > > (define * +)
> > >
> > > (display *) (newline)
> > >
> > > ;; main-test-define.scm
> > >
> > > (require test-define)
> > >
> > > (define rv (* 2 3))
> > > (display rv) (newline)
> > >
> > > #|kawa:1|# (load
> > > "/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
> > > #<procedure +>
> > > #<procedure +>
> > > 5
> > >
> > > but i do not quite understand , first display shoud have display #<procedure *>
> > > but no it displays #<procedure +>
> > >
> > >
> > > On Wed, Nov 1, 2023 at 9:39 AM Damien Mattei <damien.mattei@gmail.com> wrote:
> > > >
> > > > hello,
> > > >
> > > > i created a module this way:
> > > >
> > > > (module-name "matrix")
> > > >
> > > > (export multiply-matrix-matrix
> > > > multiply-matrix-vector
> > > > matrix
> > > > matrix-v
> > > > create-matrix-by-function
> > > > dim-matrix
> > > > matrix-ref
> > > > matrix-set!
> > > > matrix-line-ref
> > > > matrix-line-set!
> > > > vector->matrix-column
> > > > matrix-column->vector
> > > > *)
> > > >
> > > > (require Scheme+)
> > > >
> > > >
> > > > ;; (matrix #(1 2 3))
> > > > ;; matrix@4612b856
> > > >
> > > >
> > > > (define-simple-class matrix ()
> > > >
> > > > (v :: vector)
> > > >
> > > > ((*init* (vParam :: vector))
> > > > (set! v vParam))
> > > >
> > > > )
> > > >
> > > > (display "multiply : * =") (display *) (newline)
> > > >
> > > >
> > > > ;; (define M (create-matrix-by-function (lambda (i j) (+ i j)) 2 3))
> > > > (define (create-matrix-by-function fct lin col)
> > > > (matrix (create-vector-2d fct lin col)))
> > > >
> > > >
> > > > ;; return the line and column values of dimension
> > > > ;; (dim-matrix M)
> > > > ;; 2 3
> > > > (define (dim-matrix M)
> > > >
> > > > (when (not (matrix? M))
> > > > (error "argument is not of type matrix"))
> > > >
> > > > {v <+ (matrix-v M)}
> > > > {lin <+ (vector-length v)}
> > > > {col <+ (vector-length {v[0]})}
> > > > (values lin col))
> > > >
> > > > ;; #|kawa:85|# (define M1 (create-matrix-by-function (lambda (i j) (+
> > > > i j)) 2 3))
> > > > ;; #|kawa:86|# (define M2 (create-matrix-by-function (lambda (i j) (+
> > > > i j)) 3 2))
> > > > ;; #|kawa:87|# (multiply-matrix-matrix M1 M2)
> > > > ;; matrix@3fc1abf
> > > > ;; #|kawa:88|# (define M1*M2 (multiply-matrix-matrix M1 M2))
> > > > ;; #|kawa:89|# M1*M2
> > > > ;; matrix@3bf5911d
> > > > ;; #|kawa:90|# (matrix-v M1*M2)
> > > > ;; #(#(5 8) #(8 14))
> > > > ;; #|kawa:91|# (matrix-v M1)
> > > > ;; #(#(0 1 2) #(1 2 3))
> > > > ;; #|kawa:92|# (matrix-v M2)
> > > > ;; #(#(0 1) #(1 2) #(2 3))
> > > > (define (multiply-matrix-matrix M1 M2)
> > > >
> > > > {(n1 p1) <+ (dim-matrix M1)}
> > > > {(n2 p2) <+ (dim-matrix M2)}
> > > >
> > > > (when {p1 ≠ n2} (error "matrix.* : matrix product impossible,
> > > > incompatible dimensions"))
> > > >
> > > > {v1 <+ (matrix-v M1)}
> > > > {v2 <+ (matrix-v M2)}
> > > >
> > > > (define (res i j)
> > > > {sum <+ 0}
> > > > (for ({k <+ 0} {k < p1} {k <- k + 1})
> > > > {sum <- sum + v1[i][k] * v2[k][j]})
> > > > (display "sum=")(display sum) (newline)
> > > > sum)
> > > >
> > > > {v <+ (create-vector-2d res n1 p2)}
> > > >
> > > > (matrix v))
> > > >
> > > >
> > > >
> > > > (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
> > > >
> > > >
> > > >
> > > > ....
> > > >
> > > > i cut off the whole code, the code used to works with 'include' , now
> > > > that i try with modules i stuck on this error at the line
> > > > (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
> > > >
> > > > note that matrix+.scm is converted externally in matrix.scm :
> > > >
> > > > (module-name "matrix")
> > > > (export multiply-matrix-matrix multiply-matrix-vector matrix matrix-v
> > > > create-matrix-by-function dim-matrix matrix-ref matrix-set! matrix-line-ref
> > > > matrix-line-set! vector->matrix-column matrix-column->vector *)
> > > > (require Scheme+)
> > > > (define-simple-class matrix () (v :: vector)
> > > > ((*init* (vParam :: vector)) (set! v vParam)))
> > > > (display "multiply : * =")
> > > > (display *)
> > > > (newline)
> > > > (define (create-matrix-by-function fct lin col)
> > > > (matrix (create-vector-2d fct lin col)))
> > > > (define (dim-matrix M)
> > > > (when (not (matrix? M)) (error "argument is not of type matrix"))
> > > > (<+ v (matrix-v M)) (<+ lin (vector-length v))
> > > > (<+ col (vector-length (bracket-apply v 0))) (values lin col))
> > > > (define (multiply-matrix-matrix M1 M2) (<+ (n1 p1) (dim-matrix M1))
> > > > (<+ (n2 p2) (dim-matrix M2))
> > > > (when (|≠| p1 n2)
> > > > (error "matrix.* : matrix product impossible, incompatible dimensions"))
> > > > (<+ v1 (matrix-v M1)) (<+ v2 (matrix-v M2))
> > > > (define (res i j) (<+ sum 0)
> > > > (for ((<+ k 0) (< k p1) ($nfx$ k <- k + 1))
> > > > ($nfx$ sum <- sum + (bracket-apply (bracket-apply v1 i) k) *
> > > > (bracket-apply (bracket-apply v2 k) j)))
> > > > (display "sum=") (display sum) (newline) sum)
> > > > (<+ v (create-vector-2d res n1 p2)) (matrix v))
> > > > (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
> > > > (define (matrix-v M) (slot-ref M (quote v)))
> > > > (define (vector->matrix-column v)
> > > > (matrix (vector-map (lambda (x) (make-vector 1 x)) v)))
> > > > (define (matrix-column->vector Mc) (<+ v (matrix-v Mc))
> > > > (vector-map (lambda (v2) (bracket-apply v2 0)) v))
> > > > (define (multiply-matrix-vector M v) (<+ Mc (vector->matrix-column v))
> > > > (matrix-column->vector (multiply-matrix-matrix M Mc)))
> > > > (define (matrix-ref M lin col) (<+ v (matrix-v M))
> > > > (bracket-apply (bracket-apply v lin) col))
> > > > (define (matrix-set! M lin col x) (<+ v (matrix-v M))
> > > > (<- (bracket-apply (bracket-apply v lin) col) x))
> > > > (define (matrix-line-ref M lin) (<+ v (matrix-v M)) (bracket-apply v lin))
> > > > (define (matrix-line-set! M lin vect-line) (<+ v (matrix-v M))
> > > > (<- (bracket-apply v lin) vect-line))
> > > > (overload-square-brackets matrix-ref matrix-set! (matrix? number? number?))
> > > > (overload-square-brackets matrix-line-ref matrix-line-set! (matrix? number?))
> > > >
> > > >
> > > > overload-existing-operator redefine the * operator , so basically it
> > > > needs the original one to not loose the * between numbers
> > > > the code is:
> > > >
> > > > (define-syntax overload-existing-operator
> > > >
> > > > (syntax-rules ()
> > > >
> > > > ((_ orig-funct funct (pred-arg1 ...))
> > > > (define orig-funct (create-overloaded-existing-operator
> > > > orig-funct funct (list pred-arg1 ...))))))
> > > >
> > > > (define (create-overloaded-existing-operator orig-funct funct
> > > > pred-list) ;; works for associative operators
> > > >
> > > > (display "create-overloaded-existing-operator")
> > > > (display " : pred-list = ") (display pred-list) (newline)
> > > > (define old-funct orig-funct)
> > > > (define new-funct (lambda args ;; args is the list of arguments
> > > > ;; (display "new-funct: new-funct = ") (display
> > > > new-funct) (newline)
> > > > ;; (display "new-funct : pred-list = ") (display
> > > > pred-list) (newline)
> > > > ;; (display "new-funct : args = ") (display args) (newline)
> > > > (define nb-args (length args))
> > > > ;;(display "new-funct : nb-args = ") (display nb-args) (newline)
> > > > (cond ((check-arguments pred-list args) ;;(begin
> > > > ;;(display "new funct :calling:")
> > > > (display funct) (newline)
> > > > (apply funct args));;)
> > > > ((> nb-args 2) (new-funct (car args)
> > > > (apply new-funct (cdr args)))) ;;
> > > > op(a,b,...) = op(a,op(b,...))
> > > > (else
> > > > ;;(begin
> > > > ;;(display "new funct :calling: ") (display
> > > > old-funct) (newline)
> > > > (apply old-funct args)))));;)
> > > >
> > > > (display "funct: ") (display funct) (newline)
> > > > (display "orig-funct: ") (display orig-funct) (newline)
> > > > (display "old-funct: ") (display old-funct) (newline)
> > > > (display "new-funct: ") (display new-funct) (newline)
> > > >
> > > > (replace-operator! orig-funct new-funct)
> > > >
> > > > new-funct)
> > > >
> > > > this weird code return the new-funct which is the overloaded * , at
> > > > the line (overload-existing-operator * multiply-matrix-matrix
> > > > (matrix? matrix?))
> > > >
> > > > i got this error:
> > > > Exception in thread "main" java.lang.ExceptionInInitializerError
> > > > at atInteractiveLevel-8.run(exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa+.scm:43)
> > > > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
> > > > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> > > > at kawa.Shell.run(Shell.java:289)
> > > > at kawa.Shell.runFile(Shell.java:551)
> > > > at kawa.standard.load.apply2(load.java:67)
> > > > at kawa.standard.load.apply1(load.java:27)
> > > > at gnu.mapping.Procedure1or2.applyToObject(Procedure1or2.java:64)
> > > > at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75)
> > > > at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
> > > > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
> > > > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> > > > at kawa.Shell.run(Shell.java:289)
> > > > at kawa.Shell.run(Shell.java:196)
> > > > at kawa.Shell.run(Shell.java:183)
> > > > at kawa.repl.processArgs(repl.java:724)
> > > > at kawa.repl.main(repl.java:830)
> > > > Caused by: /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/kawa/matrix.scm:9:10:
> > > > unbound location: *
> > > > at gnu.mapping.PlainLocation.get(PlainLocation.java:22)
> > > > at matrix.<clinit>(matrix.scm:9)
> > > > ... 17 more
> > > >
> > > > ok * seems not bound to any procedure
> > > >
> > > > when i display it for debug i got:
> > > >
> > > > multiply : * =%
> > > >
> > > > note that % is in reversed colors (white on black background) i cannot
> > > > copy/paste it....
> > > >
> > > > all the code is called from a main file:
> > > >
> > > > (require matrix)
> > > > (require array)
> > > >
> > > > (require Scheme+)
> > > >
> > > > it seems in a module * is not bound to anything, i had a same problem
> > > > in Racket where i need to import racket/base, is there such a need in
> > > > Kawa? ,i can find anything related in the doc.
> > > >
> > > > regards,
> > > > damien
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: unbound location: *
2023-11-01 16:11 ` Damien Mattei
@ 2023-11-01 16:47 ` Damien Mattei
2023-11-01 16:57 ` Per Bothner
0 siblings, 1 reply; 12+ messages in thread
From: Damien Mattei @ 2023-11-01 16:47 UTC (permalink / raw)
To: kawa mailing list, Per Bothner
and replacing 'define' by '!' and it works more:
https://www.gnu.org/software/kawa/tutorial/Variables.html
#|kawa:1|# (load
"/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
/Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/test-define.scm:50:10:
warning - no use of create-overloaded-existing-operator2
create-overloaded-existing-operator : pred-list = (#<procedure vector?>
#<procedure vector?>)
funct: #<procedure vector-append>
orig-funct: #!null
old-funct: #!null
new-funct: #<procedure new-funct>
rv=#(1 2 3 4 5)
#|kawa:2|# +
#<procedure new-funct>
#|kawa:3|# (+ 2 3)
Argument #1 (null) to 'apply' has wrong type (expected: procedure,
sequence, or other operator)
at gnu.kawa.functions.ApplyToArgs.applyRest(ApplyToArgs.java:209)
at gnu.kawa.functions.ApplyToArgs.applyToConsumerA2A(ApplyToArgs.java:134)
at gnu.kawa.functions.Apply.applyToConsumer(Apply.java:31)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
at gnu.mapping.CallContext.runUntilValue(CallContext.java:669)
at gnu.mapping.Procedure.apply2(Procedure.java:160)
at test-define$frame.lambda2newFunct$V(test-define.scm:38)
at test-define$frame.lambda2newFunct$check(test-define.scm:24)
at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
at kawa.Shell.run(Shell.java:289)
at kawa.Shell.run(Shell.java:196)
at kawa.Shell.run(Shell.java:183)
at kawa.repl.processArgs(repl.java:724)
at kawa.repl.main(repl.java:830)
but i have no more access to previous definition that is not keep in
the overloaded procedure,see #!null values:
here are my two attempt codes:
(define (create-overloaded-existing-operator orig-funct funct
pred-list) ;; works for associative operators
(display "create-overloaded-existing-operator")
(display " : pred-list = ") (display pred-list) (newline)
(define old-funct orig-funct)
(define new-funct (lambda args ;; args is the list of arguments
;; (display "new-funct: new-funct = ") (display
new-funct) (newline)
;; (display "new-funct : pred-list = ") (display
pred-list) (newline)
;; (display "new-funct : args = ") (display args) (newline)
(define nb-args (length args))
;;(display "new-funct : nb-args = ") (display nb-args) (newline)
(cond ((check-arguments pred-list args) ;;(begin
;;(display "new funct :calling:")
(display funct) (newline)
(apply funct args));;)
((> nb-args 2) (new-funct (car args)
(apply new-funct (cdr args)))) ;;
op(a,b,...) = op(a,op(b,...))
(else
;;(begin
;;(display "new funct :calling: ") (display
old-funct) (newline)
(apply old-funct args)))));;)
(display "funct: ") (display funct) (newline)
(display "orig-funct: ") (display orig-funct) (newline)
(display "old-funct: ") (display old-funct) (newline)
(display "new-funct: ") (display new-funct) (newline)
;;(replace-operator! orig-funct new-funct)
new-funct)
(define (create-overloaded-existing-operator2 orig-funct funct
pred-list) ;; works for associative operators
(let ((old-funct orig-funct))
(letrec ((new-funct (lambda args ;; args is the list of arguments
;; (display "new-funct: new-funct = ") (display
new-funct) (newline)
;; (display "new-funct : pred-list = ") (display
pred-list) (newline)
;; (display "new-funct : args = ") (display args) (newline)
(define nb-args (length args))
;;(display "new-funct : nb-args = ") (display nb-args) (newline)
(cond ((check-arguments pred-list args) ;;(begin
;;(display "new funct :calling:") (display funct) (newline)
(apply funct args));;)
((> nb-args 2) (new-funct (car args)
(apply new-funct (cdr args)))) ;;
op(a,b,...) = op(a,op(b,...))
(else
;;(begin
;;(display "new funct :calling: ") (display
old-funct) (newline)
(apply old-funct args))))))
(display "funct: ") (display funct) (newline)
(display "orig-funct: ") (display orig-funct) (newline)
(display "old-funct: ") (display old-funct) (newline)
(display "new-funct: ") (display new-funct) (newline)
new-funct)))
with define or let and letrec it give the same #!null ????
On Wed, Nov 1, 2023 at 5:11 PM Damien Mattei <damien.mattei@gmail.com> wrote:
>
> if i modify a bit this version with define-variable instead of
> define, it seems to go further as i got an infinite loop:
>
> #|kawa:1|# (load
> "/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
> Exception in thread "main" java.lang.StackOverflowError
> at java.base/java.lang.ThreadLocal.get(ThreadLocal.java:172)
> at gnu.mapping.Environment.getCurrent(Environment.java:373)
> at gnu.mapping.DynamicLocation.lookup(DynamicLocation.java:28)
> at gnu.mapping.DynamicLocation.isBound(DynamicLocation.java:46)
> at gnu.kawa.reflect.FieldLocation.isBound(FieldLocation.java:360)
> at gnu.mapping.SharedLocation.isBound(SharedLocation.java:34)
> at gnu.mapping.InheritingEnvironment.getLocation(InheritingEnvironment.java:71)
> at gnu.mapping.DynamicLocation.lookup(DynamicLocation.java:29)
> at gnu.mapping.DynamicLocation.isBound(DynamicLocation.java:46)
> at gnu.kawa.reflect.FieldLocation.isBound(FieldLocation.java:360)
> at gnu.mapping.SharedLocation.isBound(SharedLocation.java:34)
> at gnu.mapping.InheritingEnvironment.getLocation(InheritingEnvironment.java:71)
> at gnu.mapping.DynamicLocation.lookup(DynamicLocation.java:29)
> at gnu.mapping.DynamicLocation.isBound(DynamicLocation.java:46)
> at gnu.kawa.reflect.FieldLocation.isBound(FieldLocation.java:360)
> at gnu.mapping.SharedLocation.isBound(SharedLocation.java:34)
> at gnu.mapping.InheritingEnvironment.getLocation(InheritingEnvironment.java:71)
> at gn
>
> ....
>
> On Wed, Nov 1, 2023 at 3:02 PM Damien Mattei <damien.mattei@gmail.com> wrote:
> >
> > i post a version of my problem independent to Scheme+.
> > in two attached files containing this kawa code code:
> > (module-name test-define)
> >
> > (require 'srfi-1)
> >
> > (export +)
> >
> >
> > (define (check-arguments pred-list args)
> > (if (= (length pred-list) (length args))
> > (let ((pred-arg-list (map cons pred-list args)))
> > ;;(andmap (lambda (p) ((car p) (cdr p)))
> > ;; replace andmap with every in Guile
> > (every (lambda (p) ((car p) (cdr p)))
> > pred-arg-list))
> > #f))
> >
> >
> > (define (create-overloaded-existing-operator orig-funct funct
> > pred-list) ;; works for associative operators
> >
> > (display "create-overloaded-existing-operator")
> > (display " : pred-list = ") (display pred-list) (newline)
> > (define old-funct orig-funct)
> > (define new-funct (lambda args ;; args is the list of arguments
> > ;; (display "new-funct: new-funct = ") (display
> > new-funct) (newline)
> > ;; (display "new-funct : pred-list = ") (display
> > pred-list) (newline)
> > ;; (display "new-funct : args = ") (display args) (newline)
> > (define nb-args (length args))
> > ;;(display "new-funct : nb-args = ") (display nb-args) (newline)
> > (cond ((check-arguments pred-list args) ;;(begin
> > ;;(display "new funct :calling:")
> > (display funct) (newline)
> > (apply funct args));;)
> > ((> nb-args 2) (new-funct (car args)
> > (apply new-funct (cdr args)))) ;;
> > op(a,b,...) = op(a,op(b,...))
> > (else
> > ;;(begin
> > ;;(display "new funct :calling: ") (display
> > old-funct) (newline)
> > (apply old-funct args)))));;)
> >
> > (display "funct: ") (display funct) (newline)
> > (display "orig-funct: ") (display orig-funct) (newline)
> > (display "old-funct: ") (display old-funct) (newline)
> > (display "new-funct: ") (display new-funct) (newline)
> >
> > ;;(replace-operator! orig-funct new-funct)
> >
> > new-funct)
> >
> > (define-syntax overload-existing-operator
> >
> > (syntax-rules ()
> >
> > ((_ orig-funct funct (pred-arg1 ...))
> > (define orig-funct (create-overloaded-existing-operator
> > orig-funct funct (list pred-arg1 ...))))))
> >
> >
> >
> > ; first stage overloading
> > ;;(define-overload-existing-operator +) ;; dummy in this implementation
> >
> >
> >
> > ; second stage overloading
> > (overload-existing-operator + vector-append (vector? vector?))
> >
> >
> > (display +) (newline)
> >
> >
> >
> > and a simple main:
> > (require test-define)
> >
> > (define rv (+ #(1 2) #(3 4 5)))
> > (newline) (display "rv=") (display rv) (newline)
> >
> > i load it this way:
> >
> > kawa -Dkawa.import.path=".:/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa:./kawa"
> >
> > (load "/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
> >
> > #|kawa:1|# (load
> > "/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
> > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/test-define.scm:63:29:
> > unbound location: +
> > at gnu.mapping.PlainLocation.get(PlainLocation.java:22)
> > at test-define.run(test-define.scm:63)
> > at gnu.expr.ModuleBody.run(ModuleBody.java:51)
> > at gnu.expr.ModuleBody.run(ModuleBody.java:35)
> > at atInteractiveLevel-2.run(main-test-define.scm:1)
> > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
> > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> > at kawa.Shell.run(Shell.java:289)
> > at kawa.Shell.runFile(Shell.java:551)
> > at kawa.standard.load.apply2(load.java:67)
> > at kawa.standard.load.apply1(load.java:27)
> > at gnu.mapping.Procedure1or2.applyToObject(Procedure1or2.java:64)
> > at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75)
> > at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
> > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
> > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> > at kawa.Shell.run(Shell.java:289)
> > at kawa.Shell.run(Shell.java:196)
> > at kawa.Shell.run(Shell.java:183)
> > at kawa.repl.processArgs(repl.java:724)
> > at kawa.repl.main(repl.java:830)
> >
> > On Wed, Nov 1, 2023 at 1:50 PM Damien Mattei <damien.mattei@gmail.com> wrote:
> > >
> > > a simpler example that lead to the same error:
> > >
> > > (module-name test-define)
> > >
> > > (require Scheme+)
> > >
> > > (export +)
> > >
> > > ; first stage overloading
> > > (define-overload-existing-operator +)
> > >
> > >
> > >
> > > ; second stage overloading
> > > (overload-existing-operator + vector-append (vector? vector?))
> > >
> > >
> > > (display +) (newline)
> > >
> > >
> > > a main file:
> > >
> > > (require test-define)
> > >
> > > (define rv (+ #(1 2) #(3 4 5)))
> > > (newline) (display "rv=") (display rv) (newline)
> > >
> > > result:
> > > #|kawa:1|# (load
> > > "/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/array.scm:89:6:
> > > warning - void-valued expression where value is needed
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:15:10:
> > > warning - no use of only-one?
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:18:10:
> > > warning - no use of pair-list?
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:21:10:
> > > warning - no use of empty?
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:54:10:
> > > warning - no use of insertNoDups
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:61:10:
> > > warning - no use of remove-duplicates
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:67:10:
> > > warning - no use of singleton-list?
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:73:10:
> > > warning - no use of create-list
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:88:10:
> > > warning - no use of uniq
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:97:10:
> > > warning - no use of remove-firsts-elements
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:115:10:
> > > warning - no use of remove-last
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:157:10:
> > > warning - no use of debut
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:162:10:
> > > warning - no use of debut-iter
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:173:10:
> > > warning - no use of not-list?
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:181:10:
> > > warning - no use of before-element
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:189:10:
> > > warning - no use of start-with-element
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/list.scm:198:10:
> > > warning - no use of pair-list-elements
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/overload.scm:399:10:
> > > warning - no use of
> > > find-getter-and-setter-for-overloaded-square-brackets
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/apply-square-brackets.scm:332:7:
> > > warning - void-valued expression where value is needed
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/apply-square-brackets.scm:337:7:
> > > warning - void-valued expression where value is needed
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/array.scm:
> > > note - skipped 0 errors, 29 warnings, 0 notes
> > > /Users/mattei/Library/CloudStorage/Dropbox/git/Scheme-PLUS-for-Kawa/test-define.scm:13:29:
> > > unbound location: +
> > > at gnu.mapping.PlainLocation.get(PlainLocation.java:22)
> > > at test-define.run(test-define.scm:13)
> > > at gnu.expr.ModuleBody.run(ModuleBody.java:51)
> > > at gnu.expr.ModuleBody.run(ModuleBody.java:35)
> > > at atInteractiveLevel-2.run(main-test-define.scm:1)
> > > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
> > > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> > > at kawa.Shell.run(Shell.java:289)
> > > at kawa.Shell.runFile(Shell.java:551)
> > > at kawa.standard.load.apply2(load.java:67)
> > > at kawa.standard.load.apply1(load.java:27)
> > > at gnu.mapping.Procedure1or2.applyToObject(Procedure1or2.java:64)
> > > at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75)
> > > at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
> > > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
> > > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> > > at kawa.Shell.run(Shell.java:289)
> > > at kawa.Shell.run(Shell.java:196)
> > > at kawa.Shell.run(Shell.java:183)
> > > at kawa.repl.processArgs(repl.java:724)
> > > at kawa.repl.main(repl.java:830)
> > >
> > > why + is unbound? in the worse case i should still have the default addition,no?
> > >
> > > seems something is crashing in this code without any element to debug:
> > > (define (create-overloaded-existing-operator orig-funct funct
> > > pred-list) ;; works for associative operators
> > >
> > > (display "create-overloaded-existing-operator")
> > > (display " : pred-list = ") (display pred-list) (newline)
> > > (define old-funct orig-funct)
> > > (define new-funct (lambda args ;; args is the list of arguments
> > > ;; (display "new-funct: new-funct = ") (display
> > > new-funct) (newline)
> > > ;; (display "new-funct : pred-list = ") (display
> > > pred-list) (newline)
> > > ;; (display "new-funct : args = ") (display args) (newline)
> > > (define nb-args (length args))
> > > ;;(display "new-funct : nb-args = ") (display nb-args) (newline)
> > > (cond ((check-arguments pred-list args) ;;(begin
> > > ;;(display "new funct :calling:")
> > > (display funct) (newline)
> > > (apply funct args));;)
> > > ((> nb-args 2) (new-funct (car args)
> > > (apply new-funct (cdr args)))) ;;
> > > op(a,b,...) = op(a,op(b,...))
> > > (else
> > > ;;(begin
> > > ;;(display "new funct :calling: ") (display
> > > old-funct) (newline)
> > > (apply old-funct args)))));;)
> > >
> > > (display "funct: ") (display funct) (newline)
> > > (display "orig-funct: ") (display orig-funct) (newline)
> > > (display "old-funct: ") (display old-funct) (newline)
> > > (display "new-funct: ") (display new-funct) (newline)
> > >
> > > (replace-operator! orig-funct new-funct)
> > >
> > > new-funct)
> > >
> > > On Wed, Nov 1, 2023 at 1:22 PM Damien Mattei <damien.mattei@gmail.com> wrote:
> > > >
> > > > here is a counter example:
> > > >
> > > > ;; test-define.scm
> > > >
> > > > (module-name test-define)
> > > >
> > > > (export *)
> > > >
> > > > (display *) (newline)
> > > >
> > > > (define * +)
> > > >
> > > > (display *) (newline)
> > > >
> > > > ;; main-test-define.scm
> > > >
> > > > (require test-define)
> > > >
> > > > (define rv (* 2 3))
> > > > (display rv) (newline)
> > > >
> > > > #|kawa:1|# (load
> > > > "/Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa/main-test-define.scm")
> > > > #<procedure +>
> > > > #<procedure +>
> > > > 5
> > > >
> > > > but i do not quite understand , first display shoud have display #<procedure *>
> > > > but no it displays #<procedure +>
> > > >
> > > >
> > > > On Wed, Nov 1, 2023 at 9:39 AM Damien Mattei <damien.mattei@gmail.com> wrote:
> > > > >
> > > > > hello,
> > > > >
> > > > > i created a module this way:
> > > > >
> > > > > (module-name "matrix")
> > > > >
> > > > > (export multiply-matrix-matrix
> > > > > multiply-matrix-vector
> > > > > matrix
> > > > > matrix-v
> > > > > create-matrix-by-function
> > > > > dim-matrix
> > > > > matrix-ref
> > > > > matrix-set!
> > > > > matrix-line-ref
> > > > > matrix-line-set!
> > > > > vector->matrix-column
> > > > > matrix-column->vector
> > > > > *)
> > > > >
> > > > > (require Scheme+)
> > > > >
> > > > >
> > > > > ;; (matrix #(1 2 3))
> > > > > ;; matrix@4612b856
> > > > >
> > > > >
> > > > > (define-simple-class matrix ()
> > > > >
> > > > > (v :: vector)
> > > > >
> > > > > ((*init* (vParam :: vector))
> > > > > (set! v vParam))
> > > > >
> > > > > )
> > > > >
> > > > > (display "multiply : * =") (display *) (newline)
> > > > >
> > > > >
> > > > > ;; (define M (create-matrix-by-function (lambda (i j) (+ i j)) 2 3))
> > > > > (define (create-matrix-by-function fct lin col)
> > > > > (matrix (create-vector-2d fct lin col)))
> > > > >
> > > > >
> > > > > ;; return the line and column values of dimension
> > > > > ;; (dim-matrix M)
> > > > > ;; 2 3
> > > > > (define (dim-matrix M)
> > > > >
> > > > > (when (not (matrix? M))
> > > > > (error "argument is not of type matrix"))
> > > > >
> > > > > {v <+ (matrix-v M)}
> > > > > {lin <+ (vector-length v)}
> > > > > {col <+ (vector-length {v[0]})}
> > > > > (values lin col))
> > > > >
> > > > > ;; #|kawa:85|# (define M1 (create-matrix-by-function (lambda (i j) (+
> > > > > i j)) 2 3))
> > > > > ;; #|kawa:86|# (define M2 (create-matrix-by-function (lambda (i j) (+
> > > > > i j)) 3 2))
> > > > > ;; #|kawa:87|# (multiply-matrix-matrix M1 M2)
> > > > > ;; matrix@3fc1abf
> > > > > ;; #|kawa:88|# (define M1*M2 (multiply-matrix-matrix M1 M2))
> > > > > ;; #|kawa:89|# M1*M2
> > > > > ;; matrix@3bf5911d
> > > > > ;; #|kawa:90|# (matrix-v M1*M2)
> > > > > ;; #(#(5 8) #(8 14))
> > > > > ;; #|kawa:91|# (matrix-v M1)
> > > > > ;; #(#(0 1 2) #(1 2 3))
> > > > > ;; #|kawa:92|# (matrix-v M2)
> > > > > ;; #(#(0 1) #(1 2) #(2 3))
> > > > > (define (multiply-matrix-matrix M1 M2)
> > > > >
> > > > > {(n1 p1) <+ (dim-matrix M1)}
> > > > > {(n2 p2) <+ (dim-matrix M2)}
> > > > >
> > > > > (when {p1 ≠ n2} (error "matrix.* : matrix product impossible,
> > > > > incompatible dimensions"))
> > > > >
> > > > > {v1 <+ (matrix-v M1)}
> > > > > {v2 <+ (matrix-v M2)}
> > > > >
> > > > > (define (res i j)
> > > > > {sum <+ 0}
> > > > > (for ({k <+ 0} {k < p1} {k <- k + 1})
> > > > > {sum <- sum + v1[i][k] * v2[k][j]})
> > > > > (display "sum=")(display sum) (newline)
> > > > > sum)
> > > > >
> > > > > {v <+ (create-vector-2d res n1 p2)}
> > > > >
> > > > > (matrix v))
> > > > >
> > > > >
> > > > >
> > > > > (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
> > > > >
> > > > >
> > > > >
> > > > > ....
> > > > >
> > > > > i cut off the whole code, the code used to works with 'include' , now
> > > > > that i try with modules i stuck on this error at the line
> > > > > (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
> > > > >
> > > > > note that matrix+.scm is converted externally in matrix.scm :
> > > > >
> > > > > (module-name "matrix")
> > > > > (export multiply-matrix-matrix multiply-matrix-vector matrix matrix-v
> > > > > create-matrix-by-function dim-matrix matrix-ref matrix-set! matrix-line-ref
> > > > > matrix-line-set! vector->matrix-column matrix-column->vector *)
> > > > > (require Scheme+)
> > > > > (define-simple-class matrix () (v :: vector)
> > > > > ((*init* (vParam :: vector)) (set! v vParam)))
> > > > > (display "multiply : * =")
> > > > > (display *)
> > > > > (newline)
> > > > > (define (create-matrix-by-function fct lin col)
> > > > > (matrix (create-vector-2d fct lin col)))
> > > > > (define (dim-matrix M)
> > > > > (when (not (matrix? M)) (error "argument is not of type matrix"))
> > > > > (<+ v (matrix-v M)) (<+ lin (vector-length v))
> > > > > (<+ col (vector-length (bracket-apply v 0))) (values lin col))
> > > > > (define (multiply-matrix-matrix M1 M2) (<+ (n1 p1) (dim-matrix M1))
> > > > > (<+ (n2 p2) (dim-matrix M2))
> > > > > (when (|≠| p1 n2)
> > > > > (error "matrix.* : matrix product impossible, incompatible dimensions"))
> > > > > (<+ v1 (matrix-v M1)) (<+ v2 (matrix-v M2))
> > > > > (define (res i j) (<+ sum 0)
> > > > > (for ((<+ k 0) (< k p1) ($nfx$ k <- k + 1))
> > > > > ($nfx$ sum <- sum + (bracket-apply (bracket-apply v1 i) k) *
> > > > > (bracket-apply (bracket-apply v2 k) j)))
> > > > > (display "sum=") (display sum) (newline) sum)
> > > > > (<+ v (create-vector-2d res n1 p2)) (matrix v))
> > > > > (overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
> > > > > (define (matrix-v M) (slot-ref M (quote v)))
> > > > > (define (vector->matrix-column v)
> > > > > (matrix (vector-map (lambda (x) (make-vector 1 x)) v)))
> > > > > (define (matrix-column->vector Mc) (<+ v (matrix-v Mc))
> > > > > (vector-map (lambda (v2) (bracket-apply v2 0)) v))
> > > > > (define (multiply-matrix-vector M v) (<+ Mc (vector->matrix-column v))
> > > > > (matrix-column->vector (multiply-matrix-matrix M Mc)))
> > > > > (define (matrix-ref M lin col) (<+ v (matrix-v M))
> > > > > (bracket-apply (bracket-apply v lin) col))
> > > > > (define (matrix-set! M lin col x) (<+ v (matrix-v M))
> > > > > (<- (bracket-apply (bracket-apply v lin) col) x))
> > > > > (define (matrix-line-ref M lin) (<+ v (matrix-v M)) (bracket-apply v lin))
> > > > > (define (matrix-line-set! M lin vect-line) (<+ v (matrix-v M))
> > > > > (<- (bracket-apply v lin) vect-line))
> > > > > (overload-square-brackets matrix-ref matrix-set! (matrix? number? number?))
> > > > > (overload-square-brackets matrix-line-ref matrix-line-set! (matrix? number?))
> > > > >
> > > > >
> > > > > overload-existing-operator redefine the * operator , so basically it
> > > > > needs the original one to not loose the * between numbers
> > > > > the code is:
> > > > >
> > > > > (define-syntax overload-existing-operator
> > > > >
> > > > > (syntax-rules ()
> > > > >
> > > > > ((_ orig-funct funct (pred-arg1 ...))
> > > > > (define orig-funct (create-overloaded-existing-operator
> > > > > orig-funct funct (list pred-arg1 ...))))))
> > > > >
> > > > > (define (create-overloaded-existing-operator orig-funct funct
> > > > > pred-list) ;; works for associative operators
> > > > >
> > > > > (display "create-overloaded-existing-operator")
> > > > > (display " : pred-list = ") (display pred-list) (newline)
> > > > > (define old-funct orig-funct)
> > > > > (define new-funct (lambda args ;; args is the list of arguments
> > > > > ;; (display "new-funct: new-funct = ") (display
> > > > > new-funct) (newline)
> > > > > ;; (display "new-funct : pred-list = ") (display
> > > > > pred-list) (newline)
> > > > > ;; (display "new-funct : args = ") (display args) (newline)
> > > > > (define nb-args (length args))
> > > > > ;;(display "new-funct : nb-args = ") (display nb-args) (newline)
> > > > > (cond ((check-arguments pred-list args) ;;(begin
> > > > > ;;(display "new funct :calling:")
> > > > > (display funct) (newline)
> > > > > (apply funct args));;)
> > > > > ((> nb-args 2) (new-funct (car args)
> > > > > (apply new-funct (cdr args)))) ;;
> > > > > op(a,b,...) = op(a,op(b,...))
> > > > > (else
> > > > > ;;(begin
> > > > > ;;(display "new funct :calling: ") (display
> > > > > old-funct) (newline)
> > > > > (apply old-funct args)))));;)
> > > > >
> > > > > (display "funct: ") (display funct) (newline)
> > > > > (display "orig-funct: ") (display orig-funct) (newline)
> > > > > (display "old-funct: ") (display old-funct) (newline)
> > > > > (display "new-funct: ") (display new-funct) (newline)
> > > > >
> > > > > (replace-operator! orig-funct new-funct)
> > > > >
> > > > > new-funct)
> > > > >
> > > > > this weird code return the new-funct which is the overloaded * , at
> > > > > the line (overload-existing-operator * multiply-matrix-matrix
> > > > > (matrix? matrix?))
> > > > >
> > > > > i got this error:
> > > > > Exception in thread "main" java.lang.ExceptionInInitializerError
> > > > > at atInteractiveLevel-8.run(exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa+.scm:43)
> > > > > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
> > > > > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> > > > > at kawa.Shell.run(Shell.java:289)
> > > > > at kawa.Shell.runFile(Shell.java:551)
> > > > > at kawa.standard.load.apply2(load.java:67)
> > > > > at kawa.standard.load.apply1(load.java:27)
> > > > > at gnu.mapping.Procedure1or2.applyToObject(Procedure1or2.java:64)
> > > > > at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75)
> > > > > at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
> > > > > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
> > > > > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> > > > > at kawa.Shell.run(Shell.java:289)
> > > > > at kawa.Shell.run(Shell.java:196)
> > > > > at kawa.Shell.run(Shell.java:183)
> > > > > at kawa.repl.processArgs(repl.java:724)
> > > > > at kawa.repl.main(repl.java:830)
> > > > > Caused by: /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/kawa/matrix.scm:9:10:
> > > > > unbound location: *
> > > > > at gnu.mapping.PlainLocation.get(PlainLocation.java:22)
> > > > > at matrix.<clinit>(matrix.scm:9)
> > > > > ... 17 more
> > > > >
> > > > > ok * seems not bound to any procedure
> > > > >
> > > > > when i display it for debug i got:
> > > > >
> > > > > multiply : * =%
> > > > >
> > > > > note that % is in reversed colors (white on black background) i cannot
> > > > > copy/paste it....
> > > > >
> > > > > all the code is called from a main file:
> > > > >
> > > > > (require matrix)
> > > > > (require array)
> > > > >
> > > > > (require Scheme+)
> > > > >
> > > > > it seems in a module * is not bound to anything, i had a same problem
> > > > > in Racket where i need to import racket/base, is there such a need in
> > > > > Kawa? ,i can find anything related in the doc.
> > > > >
> > > > > regards,
> > > > > damien
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: unbound location: *
2023-11-01 16:47 ` Damien Mattei
@ 2023-11-01 16:57 ` Per Bothner
2023-11-02 21:51 ` Damien Mattei
0 siblings, 1 reply; 12+ messages in thread
From: Per Bothner @ 2023-11-01 16:57 UTC (permalink / raw)
To: Damien Mattei, kawa mailing list
On 11/1/23 09:47, Damien Mattei wrote:
> but i have no more access to previous definition that is not keep in
> the overloaded procedure,see #!null values:
If you're using the module system, you can use import-with-rename
to access the "old" definition:
(import (rename other-module (foo other-foo)))
(export foo)
(define (foo ...)
(cond (xxx (other-foo ...))
(else ...)))
See https://www.gnu.org/software/kawa/Importing.html
--
--Per Bothner
per@bothner.com http://per.bothner.com/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: unbound location: *
2023-11-01 16:57 ` Per Bothner
@ 2023-11-02 21:51 ` Damien Mattei
2023-11-02 21:58 ` Per Bothner
0 siblings, 1 reply; 12+ messages in thread
From: Damien Mattei @ 2023-11-02 21:51 UTC (permalink / raw)
To: Per Bothner; +Cc: kawa mailing list
seems a good idea but i can not fix it, i try:
(import (rename (gnu kawa) (proc orig-proc)))
and (import (rename (overload) (proc orig-proc)))
as my code is in module 'overload' but the latter result in a crash:
main-test-define.scm:4:1: duplicate version reference - was #<syntax
(overload) in #3164>
main-test-define.scm:4:1: unknown library (#<syntax#2346 rename in #3164>)
#|kawa:3|# +
Exception in thread "main" java.lang.VerifyError: Bad local variable type
Exception Details:
Location:
atInteractiveLevel-5.run(Lgnu/mapping/CallContext;)V @6: aload_3
Reason:
Type top (current frame, locals[3]) is not assignable to reference type
Current Frame:
bci: @6
flags: { }
locals: { 'atInteractiveLevel-5', 'gnu/mapping/CallContext',
'gnu/lists/Consumer' }
stack: { 'gnu/lists/Consumer' }
Bytecode:
0000000: 2bb4 0008 4d2c 2db9 000e 0200 b1
at java.base/java.lang.Class.getDeclaredFields0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3473)
at java.base/java.lang.Class.getDeclaredField(Class.java:2780)
at gnu.expr.ModuleContext.findInstance(ModuleContext.java:71)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:286)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
at kawa.Shell.run(Shell.java:289)
at kawa.Shell.run(Shell.java:196)
at kawa.Shell.run(Shell.java:183)
at kawa.repl.processArgs(repl.java:724)
at kawa.repl.main(repl.java:830)
my goal is just to back-up proc under the name orig-proc as i need to
reuse it latter.
On Wed, Nov 1, 2023 at 5:58 PM Per Bothner <per@bothner.com> wrote:
>
>
>
> On 11/1/23 09:47, Damien Mattei wrote:
> > but i have no more access to previous definition that is not keep in
> > the overloaded procedure,see #!null values:
>
> If you're using the module system, you can use import-with-rename
> to access the "old" definition:
>
> (import (rename other-module (foo other-foo)))
> (export foo)
>
> (define (foo ...)
> (cond (xxx (other-foo ...))
> (else ...)))
>
> See https://www.gnu.org/software/kawa/Importing.html
> --
> --Per Bothner
> per@bothner.com http://per.bothner.com/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: unbound location: *
2023-11-02 21:51 ` Damien Mattei
@ 2023-11-02 21:58 ` Per Bothner
2023-11-03 10:42 ` Damien Mattei
0 siblings, 1 reply; 12+ messages in thread
From: Per Bothner @ 2023-11-02 21:58 UTC (permalink / raw)
To: Damien Mattei; +Cc: kawa mailing list
On 11/2/23 14:51, Damien Mattei wrote:
> seems a good idea but i can not fix it, i try:
> (import (rename (gnu kawa) (proc orig-proc)))
...
> Exception in thread "main" java.lang.VerifyError: Bad local variable type
That is probably a bug in the Kawa code generator.
I'm unlikely to have time to debug that. Certainly not without a
simplified simple-to-reproduce test-case. Even with a good test-case, this
is part of Kawa I haven't looked at in a long time, and I'm busy with other projects.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: unbound location: *
2023-11-02 21:58 ` Per Bothner
@ 2023-11-03 10:42 ` Damien Mattei
2023-11-03 10:48 ` Damien Mattei
0 siblings, 1 reply; 12+ messages in thread
From: Damien Mattei @ 2023-11-03 10:42 UTC (permalink / raw)
To: Per Bothner; +Cc: kawa mailing list
[-- Attachment #1: Type: text/plain, Size: 2225 bytes --]
in case if you have a few time to have a look to the problem i made a
simple test-case with my overloading operator problem, it is in the
two attached files and can run like that:
kawa -Dkawa.import.path="."
#|kawa:1|# (load "main-test-define.scm")
main-test-define.scm:4:1: duplicate version reference - was #<syntax
(test-define) in #91>
main-test-define.scm:4:1: unknown library (#<syntax#8 rename in #91>)
#|kawa:2|# +
Exception in thread "main" java.lang.VerifyError: Bad local variable type
Exception Details:
Location:
atInteractiveLevel-4.run(Lgnu/mapping/CallContext;)V @6: aload_3
Reason:
Type top (current frame, locals[3]) is not assignable to reference type
Current Frame:
bci: @6
flags: { }
locals: { 'atInteractiveLevel-4', 'gnu/mapping/CallContext',
'gnu/lists/Consumer' }
stack: { 'gnu/lists/Consumer' }
Bytecode:
0000000: 2bb4 0008 4d2c 2db9 000e 0200 b1
at java.base/java.lang.Class.getDeclaredFields0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3473)
at java.base/java.lang.Class.getDeclaredField(Class.java:2780)
at gnu.expr.ModuleContext.findInstance(ModuleContext.java:71)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:286)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
at kawa.Shell.run(Shell.java:289)
at kawa.Shell.run(Shell.java:196)
at kawa.Shell.run(Shell.java:183)
at kawa.repl.processArgs(repl.java:724)
at kawa.repl.main(repl.java:830)
Damien
On Thu, Nov 2, 2023 at 10:59 PM Per Bothner <per@bothner.com> wrote:
>
>
>
> On 11/2/23 14:51, Damien Mattei wrote:
> > seems a good idea but i can not fix it, i try:
> > (import (rename (gnu kawa) (proc orig-proc)))
> ...
> > Exception in thread "main" java.lang.VerifyError: Bad local variable type
>
> That is probably a bug in the Kawa code generator.
> I'm unlikely to have time to debug that. Certainly not without a
> simplified simple-to-reproduce test-case. Even with a good test-case, this
> is part of Kawa I haven't looked at in a long time, and I'm busy with other projects.
> --
> --Per Bothner
> per@bothner.com http://per.bothner.com/
[-- Attachment #2: main-test-define.scm --]
[-- Type: application/octet-stream, Size: 230 bytes --]
;;(require overload)
(require test-define)
(define-overload-existing-operator +)
(overload-existing-operator + vector-append (vector? vector?))
(define rv (+ #(1 2) #(3 4 5)))
(newline) (display "rv=") (display rv) (newline)
[-- Attachment #3: test-define.scm --]
[-- Type: application/octet-stream, Size: 3225 bytes --]
(module-name test-define)
(require 'srfi-1)
(require 'srfi-69)
;;(require infix-operators)
(export define-overload-existing-operator
overload-existing-operator)
;;+)
(define (check-arguments pred-list args)
(if (= (length pred-list) (length args))
(let ((pred-arg-list (map cons pred-list args)))
;;(andmap (lambda (p) ((car p) (cdr p)))
;; replace andmap with every in Guile
(every (lambda (p) ((car p) (cdr p)))
pred-arg-list))
#f))
(define-syntax define-overload-existing-operator
(syntax-rules ()
((_ proc)
(begin
(import (rename (test-define) (proc orig-proc)))
;;(import (rename (gnu kawa) (proc orig-proc)))
;;(require (rename-in racket/base (proc
;; orig-proc)))
(display "proc =") (display proc) (newline)
(display "orig-proc =") (display orig-proc) (newline)
(define qproc (quote proc))
(define (proc . args-lst)
;;(display "proc=") (display proc) (newline)
;;(define ht (hash-table->alist $ovrld-ht$))
;;(display ht) (newline)
(define proc-lst (hash-table-ref $ovrld-ht$ qproc)) ;; example: ((number? string?) (lambda (n s) (display n) (display s) (newline)))
;;(display "proc-lst=") (display proc-lst)
;;(newline)
(define (check-args-lst pred-list) ; check arguments list match predicates
;;(display "pred-list=") (display pred-list) (newline)
;;(display "args-lst=") (display args-lst) (newline)
(check-arguments pred-list args-lst))
(define (test-proc pred-proc-list) ; test the procedure if it matches with arguments
;;(display "pred-proc-list=") (display pred-proc-list) (newline)
(if (check-args-lst (car pred-proc-list)) ;; check args
(car (cdr pred-proc-list)) ;; return procedure
#f))
(define proc-search-result (ormap test-proc proc-lst)) ; search for a procedure matching arguments
;;(display "proc-search-result=") (display proc-search-result) (newline)
(condx (proc-search-result (apply proc-search-result args-lst))
(exec
(define nb-args (length args-lst)))
((> nb-args 2) ;;(display ">2 args") (newline)
(proc (car args-lst) (apply proc (cdr args-lst))))
(else
;;(display "else") (newline)
(apply orig-proc args-lst))))
;;(hash-table-set! $ovrld-ht$ qproc (list (list (list number? number?) orig-proc)))
(hash-table-set! $ovrld-ht$ qproc '())
;;(replace-operator! orig-proc proc)
))))
(define-syntax overload-existing-operator
(syntax-rules ()
((_ orig-funct funct (pred-arg1 ...))
(overload orig-funct funct (pred-arg1 ...)))))
(define-syntax overload
(syntax-rules ()
;; arguments are function to be overloaded, procedure that do the overloading, list of predicate to check the arguments
((_ orig-funct funct (pred-arg1 ...))
(let* ((qorig-funct (quote orig-funct))
(ovrld-lst (hash-table-ref $ovrld-ht$ qorig-funct)))
;;(display qorig-funct) (newline)
(hash-table-set! $ovrld-ht$ qorig-funct
(cons (list (list pred-arg1 ...) ;; example: ((number? string?) (lambda (n s) (display n) (display s) (newline)))
funct)
ovrld-lst))))))
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: unbound location: *
2023-11-03 10:42 ` Damien Mattei
@ 2023-11-03 10:48 ` Damien Mattei
0 siblings, 0 replies; 12+ messages in thread
From: Damien Mattei @ 2023-11-03 10:48 UTC (permalink / raw)
To: Per Bothner; +Cc: kawa mailing list
[-- Attachment #1: Type: text/plain, Size: 2537 bytes --]
i forgot a few definitions and include file in the previous post.
It is okay now with the new attachments.
Damien
On Fri, Nov 3, 2023 at 11:42 AM Damien Mattei <damien.mattei@gmail.com> wrote:
>
> in case if you have a few time to have a look to the problem i made a
> simple test-case with my overloading operator problem, it is in the
> two attached files and can run like that:
>
> kawa -Dkawa.import.path="."
> #|kawa:1|# (load "main-test-define.scm")
> main-test-define.scm:4:1: duplicate version reference - was #<syntax
> (test-define) in #91>
> main-test-define.scm:4:1: unknown library (#<syntax#8 rename in #91>)
> #|kawa:2|# +
> Exception in thread "main" java.lang.VerifyError: Bad local variable type
> Exception Details:
> Location:
> atInteractiveLevel-4.run(Lgnu/mapping/CallContext;)V @6: aload_3
> Reason:
> Type top (current frame, locals[3]) is not assignable to reference type
> Current Frame:
> bci: @6
> flags: { }
> locals: { 'atInteractiveLevel-4', 'gnu/mapping/CallContext',
> 'gnu/lists/Consumer' }
> stack: { 'gnu/lists/Consumer' }
> Bytecode:
> 0000000: 2bb4 0008 4d2c 2db9 000e 0200 b1
>
> at java.base/java.lang.Class.getDeclaredFields0(Native Method)
> at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3473)
> at java.base/java.lang.Class.getDeclaredField(Class.java:2780)
> at gnu.expr.ModuleContext.findInstance(ModuleContext.java:71)
> at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:286)
> at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> at kawa.Shell.run(Shell.java:289)
> at kawa.Shell.run(Shell.java:196)
> at kawa.Shell.run(Shell.java:183)
> at kawa.repl.processArgs(repl.java:724)
> at kawa.repl.main(repl.java:830)
>
> Damien
>
> On Thu, Nov 2, 2023 at 10:59 PM Per Bothner <per@bothner.com> wrote:
> >
> >
> >
> > On 11/2/23 14:51, Damien Mattei wrote:
> > > seems a good idea but i can not fix it, i try:
> > > (import (rename (gnu kawa) (proc orig-proc)))
> > ...
> > > Exception in thread "main" java.lang.VerifyError: Bad local variable type
> >
> > That is probably a bug in the Kawa code generator.
> > I'm unlikely to have time to debug that. Certainly not without a
> > simplified simple-to-reproduce test-case. Even with a good test-case, this
> > is part of Kawa I haven't looked at in a long time, and I'm busy with other projects.
> > --
> > --Per Bothner
> > per@bothner.com http://per.bothner.com/
[-- Attachment #2: main-test-define.scm --]
[-- Type: application/octet-stream, Size: 230 bytes --]
;;(require overload)
(require test-define)
(define-overload-existing-operator +)
(overload-existing-operator + vector-append (vector? vector?))
(define rv (+ #(1 2) #(3 4 5)))
(newline) (display "rv=") (display rv) (newline)
[-- Attachment #3: test-define.scm --]
[-- Type: application/octet-stream, Size: 3319 bytes --]
(module-name test-define)
(require 'srfi-1)
(require 'srfi-69)
;;(require infix-operators)
(export define-overload-existing-operator
overload-existing-operator)
;;+)
(include "condx.scm")
(define $ovrld-ht$ (make-hash-table)) ;; for procedure and operators
(define (check-arguments pred-list args)
(if (= (length pred-list) (length args))
(let ((pred-arg-list (map cons pred-list args)))
;;(andmap (lambda (p) ((car p) (cdr p)))
;; replace andmap with every in Guile
(every (lambda (p) ((car p) (cdr p)))
pred-arg-list))
#f))
(define-syntax define-overload-existing-operator
(syntax-rules ()
((_ proc)
(begin
(import (rename (test-define) (proc orig-proc)))
;;(import (rename (gnu kawa) (proc orig-proc)))
;;(require (rename-in racket/base (proc
;; orig-proc)))
(display "proc =") (display proc) (newline)
(display "orig-proc =") (display orig-proc) (newline)
(define qproc (quote proc))
(define (proc . args-lst)
;;(display "proc=") (display proc) (newline)
;;(define ht (hash-table->alist $ovrld-ht$))
;;(display ht) (newline)
(define proc-lst (hash-table-ref $ovrld-ht$ qproc)) ;; example: ((number? string?) (lambda (n s) (display n) (display s) (newline)))
;;(display "proc-lst=") (display proc-lst)
;;(newline)
(define (check-args-lst pred-list) ; check arguments list match predicates
;;(display "pred-list=") (display pred-list) (newline)
;;(display "args-lst=") (display args-lst) (newline)
(check-arguments pred-list args-lst))
(define (test-proc pred-proc-list) ; test the procedure if it matches with arguments
;;(display "pred-proc-list=") (display pred-proc-list) (newline)
(if (check-args-lst (car pred-proc-list)) ;; check args
(car (cdr pred-proc-list)) ;; return procedure
#f))
(define proc-search-result (ormap test-proc proc-lst)) ; search for a procedure matching arguments
;;(display "proc-search-result=") (display proc-search-result) (newline)
(condx (proc-search-result (apply proc-search-result args-lst))
(exec
(define nb-args (length args-lst)))
((> nb-args 2) ;;(display ">2 args") (newline)
(proc (car args-lst) (apply proc (cdr args-lst))))
(else
;;(display "else") (newline)
(apply orig-proc args-lst))))
;;(hash-table-set! $ovrld-ht$ qproc (list (list (list number? number?) orig-proc)))
(hash-table-set! $ovrld-ht$ qproc '())
;;(replace-operator! orig-proc proc)
))))
(define-syntax overload-existing-operator
(syntax-rules ()
((_ orig-funct funct (pred-arg1 ...))
(overload orig-funct funct (pred-arg1 ...)))))
(define-syntax overload
(syntax-rules ()
;; arguments are function to be overloaded, procedure that do the overloading, list of predicate to check the arguments
((_ orig-funct funct (pred-arg1 ...))
(let* ((qorig-funct (quote orig-funct))
(ovrld-lst (hash-table-ref $ovrld-ht$ qorig-funct)))
;;(display qorig-funct) (newline)
(hash-table-set! $ovrld-ht$ qorig-funct
(cons (list (list pred-arg1 ...) ;; example: ((number? string?) (lambda (n s) (display n) (display s) (newline)))
funct)
ovrld-lst))))))
[-- Attachment #4: condx.scm --]
[-- Type: application/octet-stream, Size: 3038 bytes --]
;; condx: cond(itionals) with optional execution of statements before
;
; This file is part of Scheme+
;; Copyright 2021 Damien MATTEI
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
; example:
;(define x 1)
;(condx ((= x 7) 'never)
; (exec
; (define y 3)
; (set! x 7))
; ((= y 1) 'definitely_not)
; (exec
; (set! y 10)
; (define z 2))
; ((= x 7) (+ x y z))
; (else 'you_should_not_be_here))
;
; 19
(define-syntax condx
(syntax-rules (exec else)
((_) '()) ;; allow no else clause
((_ (else e ...))
(let () e ...))
((_ (exec s ...) d1 ...)
(let () s ... (condx d1 ...)))
((_ (t e ...) tail ...)
(if t
(let () e ...)
(condx tail ...)))))
;; (define-syntax condx
;; (syntax-rules (exec else)
;; ((_)
;; (error 'condx "No else clause"))
;; ((_ (else e ...))
;; (let () e ...))
;; ((_ (exec s ...) d1 ...)
;; (let () s ... (condx d1 ...)))
;; ((_ (t e ...) tail ...)
;; (if t
;; (let () e ...)
;; (condx tail ...)))))
;; warning this ones behaves differently (can not remember the problem)
(define-syntax condx-begin
(syntax-rules (exec else)
((_) '()) ;; allow no else clause
((_ (else e ...))
(begin e ...))
((_ (exec s ...) d1 ...)
(begin s ... (condx-begin d1 ...)))
((_ (t e ...) tail ...)
(if t
(begin e ...)
(condx-begin tail ...)))))
;; (define-syntax condx-begin
;; (syntax-rules (exec else)
;; ((_)
;; (error 'condx-begin "No else clause"))
;; ((_ (else e ...))
;; (begin e ...))
;; ((_ (exec s ...) d1 ...)
;; (begin s ... (condx-begin d1 ...)))
;; ((_ (t e ...) tail ...)
;; (if t
;; (begin e ...)
;; (condx-begin tail ...)))))
;; (define x 1)
;; (condx ((= x 7) 'never)
;; (exec
;; (define y 3)
;; (set! x 7))
;; ((= y 1) 'definitely_not)
;; (exec
;; (set! y 10)
;; (define z 2))
;; ((= x 7) (+ x y z))
;; (else 'you_should_not_be_here))
;; (define y 0)
;; (define z 0)
;; (set! x 1)
;; (condx-begin ((= x 7) 'never)
;; (exec
;; (set! y 3)
;; (set! x 7))
;; ((= y 1) 'definitely_not)
;; (exec
;; (set! y 10)
;; (set! z 2))
;; ((= x 7) (+ x y z))
;; (else 'you_should_not_be_here))
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2023-11-03 10:48 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-01 8:39 unbound location: * Damien Mattei
2023-11-01 12:22 ` Damien Mattei
2023-11-01 12:50 ` Damien Mattei
2023-11-01 14:02 ` Damien Mattei
2023-11-01 16:11 ` Damien Mattei
2023-11-01 16:47 ` Damien Mattei
2023-11-01 16:57 ` Per Bothner
2023-11-02 21:51 ` Damien Mattei
2023-11-02 21:58 ` Per Bothner
2023-11-03 10:42 ` Damien Mattei
2023-11-03 10:48 ` Damien Mattei
2023-11-01 14:55 ` Per Bothner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).