copy pasting sweet expressions
Jos Koot
(07 Mar 2013 02:48 UTC)
|
Re: copy pasting sweet expressions Alan Manuel Gloria (07 Mar 2013 04:37 UTC)
|
Re: copy pasting sweet expressions
David A. Wheeler
(07 Mar 2013 05:10 UTC)
|
RE: copy pasting sweet expressions
Jos Koot
(07 Mar 2013 10:39 UTC)
|
RE: #!sweet (was copy pasting sweet expressions)
David A. Wheeler
(12 Mar 2013 01:47 UTC)
|
Re: copy pasting sweet expressions Alan Manuel Gloria 07 Mar 2013 04:31 UTC
On 3/7/13, Jos Koot <xxxxxx@gmail.com> wrote: > Nice idea, but how to deal with my frequent copy/paste actions in the > definitionss window of DrRacket? > > For sexprs, copy/paste is easy in the definitions window of DrRacket. Just > copy/paste and reindent. How easy would this be with sweet expressions? Can > we copy/paste at a choosen level of indentation? > > Say I have a definition > > (define (f a b c) > def/expr ... > last-expr) > > When I am not sure that function f produces correct results, I modify it > temporarily as: > > (define (f a b c) (let ((r (let() > def/expr ... > last-expr))) (printf "result of proc f: ~s~n~n" r) r)) > > Notice that here the indenting is deliberately wrong. Using the temporal > "let ((r" form I don't care about the indenting. After seeing what is going > on I use ctl Z in order to remove the extra let-form and the print-form. > How > would this be with sweet expressions? Normally for myself I keep a probe() definition handy: define probe(x) display "probe: " \\ write x \\ (newline) Then whatever I need to probe, I just convert: define (f a b c) def/expr ... last-expr to: define (f a b c) $ probe $ let () def/expr ... last-expr -- SUBLIST rocks. probe can also be a macro: define-syntax probe ! syntax-rules () ! \\ ! ! probe x ! ! \\ ! ! let ! ! $ v $ x ! ! write 'x ; show the expression ! ! display ": " ! ! write v ! ! v > > Wish you good luck. A sweet expressions language is certainly possible in > Racket. If i can be useful for (parts of) the implementation,mail me > privately. Yes, although I worry that it'll require a #lang declaration rather than our preferred #!sweet form... Is the latter possible in Racket? AFAIK all Racket languages require a #lang form, I'm not at all certain it's possible to use #!sweet. (Note: I haven't gone digging through Racket docs, so correct me if I'm wrong here) Still, not a big problem, and it seems that Racket's current #lang will do quite well. Sincerely, AmkG