Re: conditional based on binding of a variable

2024-04-15 Thread Damien Mattei
scheme@(guile-user)> (define (foo2) (define x 7) (defined-symbol? x)) scheme@(guile-user)> (foo2) $2 = #t On Tue, Apr 16, 2024 at 8:36 AM Damien Mattei wrote: > this could not works because the defined-symbol? used in the macro > if-defined return false because at the expansion of the macro the

Re: conditional based on binding of a variable

2024-04-15 Thread Damien Mattei
this could not works because the defined-symbol? used in the macro if-defined return false because at the expansion of the macro the symbol is not defined. Instead at run-time, this works: #|kawa:21|# (define (foo2) (define x 7) (defined-symbol? x)) #|kawa:22|# (foo2) #t On Sun, Apr 14, 2024 at

Re: conditional based on binding of a variable

2024-04-14 Thread Damien Mattei
i tried this, that works in some case: ;; scheme@(guile-user)> (defined-symbol? d) ;; ;;; :20:17: warning: possibly unbound variable `d' ;; $3 = #f (define-syntax defined-symbol? (syntax-rules () ((_ x) (call-with-current-continuation (lambda (exit) (with-exception-handler (lam

Re: conditional based on binding of a variable

2024-04-12 Thread Damien Mattei
indeed ,seems not a thing feasible ,unless in Racket where it works great: https://stackoverflow.com/questions/3267351/how-do-i-test-whether-a-variable-is-defined-before-referencing-it?noredirect=1&lq=1 On Fri, Apr 12, 2024 at 12:34 AM Damien Mattei wrote: > > hello, > > i'm searching the equiv