[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: copy pasting sweet expressions
Oh, I see, very simple indeed.
From: Alan Manuel Gloria [mailto:almkglor@xxxxxxxxx]
Sent: jueves, 07 de marzo de 2013 5:31
To: Jos Koot
Subject: Re: copy pasting sweet expressions
On 3/7/13, Jos Koot <jos.koot@xxxxxxxxx> 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?
> we copy/paste at a choosen level of indentation?
> Say I have a definition
> (define (f a b c)
> def/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
> on I use ctl Z in order to remove the extra let-form and the print-form.
> would this be with sweet expressions?
Normally for myself I keep a probe() definition handy:
display "probe: " \\ write x \\ (newline)
Then whatever I need to probe, I just convert:
define (f a b c)
define (f a b c) $ probe $ let ()
probe can also be a macro:
! 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
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.