Rebinding parameters to a function call in scheme?

First: you are mixing code and data. It looks alike in Scheme but it is not the same. Second: an expression does not have a first argument.

Only a function call has a first argument So you do not talk about an expression but a function with an argument list. And if you have a function and a list of arguments, it is quite easy to write a bind function, which calls the original function with a modified argument list. It is done this way: This is an old function, which takes some arguments and does anything with them: (define (old-func .

Args) (display "old-func: ") (write args) (newline)) (old-func 1 2 3) -> old-func: (1 2 3) This is the bind function wich takes the old function and a new first-argument and returns a new function which calls the old function with the modified argument list (define (bind-func first-arg old-func) (lambda args (apply old-func (cons first-arg args)))) And this is the way it works: (define new-func (bind-func "new" old-func)) (new-func 1 2 3) -> old-func: ("new" 1 2 3).

First: you are mixing code and data. It looks alike in Scheme but it is not the same. Second: an expression does not have a first argument.

Only a function call has a first argument. So you do not talk about an expression but a function with an argument list. And if you have a function and a list of arguments, it is quite easy to write a bind function, which calls the original function with a modified argument list.It is done this way: This is an old function, which takes some arguments and does anything with them: (define (old-func .

Args) (display "old-func: ") (write args) (newline)) (old-func 1 2 3) -> old-func: (1 2 3) This is the bind function wich takes the old function and a new first-argument and returns a new function which calls the old function with the modified argument list. (define (bind-func first-arg old-func) (lambda args (apply old-func (cons first-arg args)))) And this is the way it works: (define new-func (bind-func "new" old-func)) (new-func 1 2 3) -> old-func: ("new" 1 2 3).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions