unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Damien Mattei <damien.mattei@gmail.com>
To: guile-user <guile-user@gnu.org>
Subject: syntax and undefined variable
Date: Tue, 10 Sep 2024 15:09:39 +0200	[thread overview]
Message-ID: <CADEOadeK_xASnuC8d3BK_=s+CZ4-qYHotH-Z+SgeQbgwbuwUoA@mail.gmail.com> (raw)

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	other threads:[~2024-09-10 13:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADEOadeK_xASnuC8d3BK_=s+CZ4-qYHotH-Z+SgeQbgwbuwUoA@mail.gmail.com' \
    --to=damien.mattei@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).