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

Re: Portability (long) ...(now short)

        ALIAS is useful in porting code and exists in current implementations
        (PCScheme, Scheme-84).  Yes, all implementation have ways of providing
        syntactic extensions.  The problem is that few of them are the same
        (macro, define-macro, define-syntax, extend-syntax, ...).  I can't write
        ALIAS portably.  
    I still find your argument circular.  Please give me an example where
    ALIAS solves anything by itself, ie. without any conditionalization.
ALIAS can be used to ease porting of code by obviating the need to go
through text files with an editor doing alpha-conversion `by hand'.  I
guess that I am really impatient to get a uniform syntax system.  If we
have to live with the current situation for another couple of years,
ALIAS and friends can be of some help.  If we get syntax soon, we can
(and should) flush most syntax [although LET, LETREC, etc. would be nice
to keep, moving DO to the Yellow Pages would make quite a few people

        BOUND? may be a primitive procedure which accesses the environment of the
        call via agreement between the compiler and runtime system.  Isn't
        requiring it to be a special form overspecification?  
    Therefore you would have
    (let ((foo 3))
      (bound? 'foo))
    return #T
    (define (check name)
      (bound? name))
    and separately compiled
    (let ((foo 3))
      (check? 'foo))
    return #F?  I don't believe you are really proposing this.  This
    violates all forms of referential transparency that I can think of.

NO!! The above should return #t!  The agreement I was thinking of is use
of registers, shape of environment (ribcage, display, etc.) and so fourth.
If a compiler can recognize BOUND? as constant, it can do the elimination
of the test in the above case and just generate code to return #t.
Likewise for the CHECK case if you change the definition of CHECK to use
DEFINE-CONSTANT and the compiler has access to the seperately compiled
unit's binding information.  

The more interesting question is when the BOUND? check can take place and
in what environment (read, compile, run).  I would prefer to have this
resolved in the compile time environment so that no code is ever
generated to do the test.  This is definately an environment problem
(unless we make such a function a part of the core language [to quote you:
"Yuck!"]).  I guess the real question here is "Is the cure worse than the
disease?".  What I want is a (cheap) way to test for desired
functionality, not just names.  Perhaps we need to wait for a module
system and specification language.