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

(define (foo bool... and redefinition of sys funcs



>>>
>>>  (define (foo bool)
>>>   (if bool
>>>       (define (result) #true)
>>>       (define (result) #false))
>>>   (result))
>>>
The way i'd read this is:

If bool is true then define the procedure called 'result' as the value #true,
which obviously doesn't make sense, and then return the result of calling the
procedure 'result' which *should* be impossible as it's a value, not a
procedure.

Surely defining it like this is better
(define (foo bool)
   (if bool
        (define result #true)
        (define result #false))
   result)

Is this the correct way to read scheme, or am I mistaken(the above works fine
in xscheme).

Regarding the redefinition of system functions, I'd prefer to be able to
redefine them at will, BUT I think everybody wants control over their own
programs, but also without altering the workings of already defined procedures.
I think it would be best if compiled functions couldn't be altered by
redefining a function (i.e like cschemes fasloaded functions), this will allow
you to redefine, say, the display function so that it sends its output to a
file instead, for *your* program and your program only and not all the older
functions which have been, in effect, added to your version of the language.

Does this seem reasonable?



btw do many other people work with xscheme at all, its a bit limited by the pc
memory constraints but apart from that i find it to be excellent as it's so
quick to try things out in.




+-----------------------------------------------------------------------------+
|Ian Murphy                     | Internet   : IAN@VAX1.UCC.IE                |
|Dept. Computer Science         | ARPA       : IAN@IRUCCVAX.BITNET            |
|University College Cork,       | janet      : EARN%IRL.HEA.UCC.IRUCCVAX::IAN |
|Ireland.                       | Voice      : "IAN!!!"                       |
+-----------------------------------------------------------------------------+