guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

syntax and undefined variable


From: Damien Mattei
Subject: syntax and undefined variable
Date: Tue, 10 Sep 2024 15:09:39 +0200

hello,

when i try to simplify my code that works it no more works, if change
#'list by list it fails with this strange error:
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure variable-ref: Unbound variable: #<variable 76e5ef9478f0 value:
#<undefined>>

the code is:

(define-syntax $bracket-apply$

  (lambda (stx)

    (syntax-case stx ()

      (($bracket-apply$ container arg-bracket ...) ;  . args-brackets


       (with-syntax ((parsed-args ;;#`(list
#,@(parse-square-brackets-arguments-lister-syntax #`(#,@#'args-brackets)))))

     (cons #'list ; list : cause ERROR in start-λογικι-guile+.scm
(logic-test) : ice-9/boot-9.scm:1685:16: In procedure raise-exception:
   ;; In procedure variable-ref: Unbound variable: #<variable 785f3e25c8f0
value: #<undefined>>
         (parse-square-brackets-arguments-lister-syntax #'(arg-bracket
...)))))

   (display "$bracket-apply$ : #'parsed-args=") (display #'parsed-args)
(newline)

   #'($bracket-apply$next4list-args container parsed-args))))))

the strange things is that it can ran on complex code that use this library
(bracket-apply) but fail with others one.

It is not important as i have a good working version but if someone have an
idea?
the problem is that i have no idea for debug of which value is undefined as
the back trace just output this:

scheme@(guile-user)> (logic-test)
test 1
(or (and (not a) (not b) (not c) (not d)) (and (not a) (not b) (not c) d)
(and (not a) (not b) c (not d)) (and (not a) b (not c) d) (and (not a) b c
(not d)) (and (not a) b c d) (and a (not b) (not c) (not d)) (and a (not b)
(not c) d) (and a (not b) c (not d)) (and c (not d))) =
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure variable-ref: Unbound variable: #<variable 76e5ef9478f0 value:
#<undefined>>

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ,bt
In ice-9/eval.scm:
    619:8 14 (_ #(#(#(#<directory (guile-user) 76e5f8912c80>)
#<continuation 76e5f6690be0>) #<variable 76…> …))
   626:19 13 (_ #(#(#(#<directory (guile-user) 76e5f8912c80>)
#<continuation 76e5f6690be0>) #<variable 76…> …))
    155:9 12 (_ #(#(#<directory (guile-user) 76e5f8912c80>) (or (and (not
a) (not b) (not c) (not d)) (…) …)))
    619:8 11 (_ #(#(#(#<directory (guile-user) 76e5f8912c80>) (or (and (not
a) (not b) (not c) (# …)) …)) # …))
   626:19 10 (_ #(#(#(#<directory (guile-user) 76e5f8912c80>) (or (and (not
a) (not b) (not c) (# …)) …)) # …))
    619:8  9 (_ #(#(#(#<directory (guile-user) 76e5f8912c80> (a b c d) (or
(and c (not d)) (and …) …)) #) # …))
   626:19  8 (_ #(#(#(#<directory (guile-user) 76e5f8912c80> (a b c d) (or
(and c (not d)) (and …) …)) #) # …))
In unknown file:
           7 (sort ((1 1 1 0) (1 0 1 0) (1 0 0 1) (1 0 0 0) (0 1 1 1) (0 1
1 0) (0 1 0 1) (0 0 1 0) (0 …) #) #)
In ice-9/eval.scm:
    619:8  6 (_ #(#(#(#<directory (minterms+) 76e5ecfab280>) (1 0 0 1) (1 0
1 0)) #<variable 76e5ef947910 …>))
   626:19  5 (_ #(#(#(#<directory (minterms+) 76e5ecfab280>) (1 0 0 1) (1 0
1 0)) #<variable 76e5ef947910 …>))
    619:8  4 (_ #(#(#(#<directory (minterms+) 76e5ecfab280>) (1 0 0 1))
#<variable 76e5ef947900 value: #<…> …))
   304:50  3 (_ #(#(#(#<directory (minterms+) 76e5ecfab280>) (1 0 0 1))
#<variable 76e5ef947900 value: #<…> …))
   196:27  2 (_ #(#(#(#<directory (minterms+) 76e5ecfab280>) (1 0 0 1))
#<variable 76e5ef947900 value: #<…> …))
    227:9  1 (_ _)
In ice-9/boot-9.scm:
  1685:16  0 (raise-exception _ #:continuable? _)

damien


reply via email to

[Prev in Thread] Current Thread [Next in Thread]