Re: [racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-31 Thread Mark Watts
inline On Sat, Dec 28, 2013 at 1:01 PM, Scott Klarenbach wrote: > Matthias, > ... > As an aside: > > >> This might be a MIT misunderstanding about the relationship between >> Scheme and the lambda calculus. It is certainly not possible in general and >> I see no pragmatic use case for an approx

Re: [racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-29 Thread Matthias Felleisen
That's precisely what (2) was getting at. Good luck and SOS as much as you need -- Matthias On Dec 29, 2013, at 6:23 PM, Scott Klarenbach wrote: > I think I have a much simpler approach for my purposes. I can have a > (define-expression ...) macro that basically just stores the expression a

Re: [racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-29 Thread Scott Klarenbach
I think I have a much simpler approach for my purposes. I can have a (define-expression ...) macro that basically just stores the expression as a quoted list. This largely emulates c#'s expression trees, but with a lot less hassle and ugly syntax. I can then achieve the composition I desire thro

Re: [racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-29 Thread Scott Klarenbach
Thanks Greg. > Geiser mode for Emacs provides both of these things. I use Geiser mode but find it pretty lacking for this purpose. Some of the time it provides documentation, but a lot of the time it doesn't provide anything. It may be that I have to upgrade my version or look into the config

Re: [racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-29 Thread Matthias Felleisen
On Dec 28, 2013, at 2:01 PM, Scott Klarenbach wrote: > I'm playing around with the idea of a sort of "Language Integrated Query" > like LINQ. For example: > > > (sql (query 'my-table > #:where (λ (row) (> (hash-ref row 'id) 3 > "select * from my-table where id > 3" > I understand yo

Re: [racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-29 Thread Greg Hendershott
On Sat, Dec 28, 2013 at 2:01 PM, Scott Klarenbach wrote: > It would be really nice to print the source code of a known procedure on the > repl, in order to get a quick view of what it does. Or, the "pa" function > which prints out the arguments of a procedure is even more useful. A few ideas her

Re: [racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-28 Thread Scott Klarenbach
Matthias, I'm likely very misguided here and really just learning by hacking around, so bare with me :). I'm playing around with the idea of a sort of "Language Integrated Query" like LINQ. For example: > (sql (query 'my-table #:where (λ (row) (> (hash-ref row 'id) 3 "select * from my-

Re: [racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-27 Thread Neil Van Dyke
Matthias has good points about why the base Racket language does not do this, but if you want to do language experiments, or if you have really unusual practical requirements, you can still use Racket as a language platform... You could define your own "#lang" variant of Racket that stores the

Re: [racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-27 Thread Matthias Felleisen
On Dec 27, 2013, at 6:27 PM, Scott Klarenbach wrote: > I noticed that MIT Scheme has the "pp" procedure which prints the source code > of a given function. Is there an equivalent way to do this in Racket? No. The 'pp' idea probably dates back to the age of Lisp-machine repls when MIT program

[racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-27 Thread Scott Klarenbach
I noticed that MIT Scheme has the "pp" procedure which prints the source code of a given function. Is there an equivalent way to do this in Racket? More generally, I'm looking to normalize nested procedures to their most rudimentary expressions. For example: (define (something? x) (> x 3)) (def