-1

As per my understanding scheme procedures like map,apply,append etc are written in scheme itself. Is there an easy way to see the implementation of these procedues right inside the REPL ?

sudhirc
  • 125
  • 2
  • 12

1 Answers1

1

I do not believe there is a standard way to dump the source code of a procedure, but a lot of the list functions are defined here, and you can look through the source code for your implementation to see the rest. Note that apply is probably a primitive, though.

Jeremiah Willcock
  • 30,161
  • 7
  • 76
  • 78
  • @sudhirc: You probably can't, since it relies on the details of procedure application in ways that you normally can't use in Scheme. – Jeremiah Willcock Feb 21 '11 at 16:38
  • JFGI: http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=implement+scheme+apply – Marcin Feb 21 '11 at 16:40
  • @Marcin: Those are for implementing your own Scheme interpreter, I think. Is there a way to define `apply` for an existing Scheme system without using any primitives that are equivalent to `apply`? – Jeremiah Willcock Feb 21 '11 at 16:47
  • This is a standard exercise. The answer is yes, you can google it. This smells terribly like you are trying to get us to do your homework. – Marcin Feb 21 '11 at 16:53
  • @Marcin: Your criticism is valid but my original question is about viewing the pre implemented procedure details in REPL. Asking for apply implementation was an impulsive comment after searching through the SRFI-1 library for an implementation. I will be more careful in future. – sudhirc Feb 21 '11 at 17:57