chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] unbound variable: or


From: chi
Subject: Re: [Chicken-users] unbound variable: or
Date: Sat, 30 May 2015 22:30:38 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 05/30/2015 07:02 AM, Peter Bex wrote:
> As has been pointed out time and again, it is fundamentally broken.

Generally when that is true, you can link to a prepared document explaining it
clearly and unambiguously. Since it has been carefully explained, and rehashed
to the point of ad nauseum, could you link to where it is explained why
define-macro is fundamentally broken? Because I can't find such a document for
the life of me.

I mean it's obvious define-macro is a bad idea, because
(define-macro (foo bar)
  '(define x 23))

(define x 42)
(foo bar)
(write x)
(newline)

...is confusing as all heck. But I can't find anywhere that really explains why
that's _fundamentally_ broken, not just ugly.

Incidentally, I'm pretty sure define-syntax isn't hygenic. syntax-rules is
hygenic. You can still ruin yourself with define-syntax, like:

(define-syntax a
  (lambda (form rename compare)
    '(define b 23)))

(define b 42)
(a)
(write b)
(newline)

...and I would like to state for the record that even defining hygenic syntax is
a pretty ruinous idea. You have to be very careful of what you're doing, and
confident that it's a good idea, because it is literally impossible for someone
to tell what your program means without first calculating all of the syntax
rules you have defined in their head. It's so easy to mess with syntax in
Scheme, and that can be a double edged sword, where the code you produce is
completely inscrutable because nobody can figure out what the final result of
syntax producing syntax producing syntax will be.

It is kind of fun that you can write an uncomputable program though.

(define-syntax make-cool-program
  ;; this is gonna be totally awesome guys
  (lambda (form rename compare)
    (let loop ()
      (loop))))

(make-cool-program)



reply via email to

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