[racket-dev] [plt] Push #21078: master branch updated

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Sep 14 10:13:59 EDT 2010

Right -- this is why I suggested a simple extension: allow tools to
change the default values.  Without that, the current situation is
creating more implicit dependencies such as this commit.


Not too related: the reason that I need to actually change the
preferences is that students already had the (lacking) default in
their preferences.  One way to solve that would be to record in the
preference only the divergence from the default -- what you added and
what you removed -- so changing the default will propagate as needed.
But this is a UI problem (if you click "OK" -- does that mean that you
want the current set and nothing else?), and a better solution would
be a "restore defaults" button.


On Sep 13, Robby Findler wrote:
> But this is editing the user's preferences, not setting the defaults.
> 
> Robby
> 
> On Mon, Sep 13, 2010 at 3:52 PM, Eli Barzilay <eli at barzilay.org> wrote:
> > On Sep 13, Robby Findler wrote:
> >> DrRacket doesn't yet have good tool support for such things, but it
> >> should at least look at the #lang line for indentation and probably
> >> will do that at some point (in which case the dialog will change to
> >> be letting you add things to what the #lang line specifies instead
> >> of just specifying everything). But not today, I'm sorry to say.
> >
> > Here's the code from my class tool:
> >
> >    (define (add-form-specs)
> >      (define (sethash! t key val)
> >        (unless (hash-ref t key #f) (hash-set! t key val)))
> >      (define (setalist l key val)
> >        (if (assoc key l) l (cons (list key val) l)))
> >      (let ([t (car (preferences:get 'framework:tabify))])
> >        (for ([s '(define: define-type)])
> >          (sethash! t s 'define))
> >        (for ([s '(lambda: cases)])
> >          (sethash! t s 'lambda)))
> >      (let* ([l1 (preferences:get 'framework:square-bracket:cond/offset)]
> >             [l2 (setalist l1 "define-type" 1)]
> >             [l2 (setalist l2 "cases" 1)]
> >             [l2 (setalist l2 "match" 1)])
> >        (unless (equal? l1 l2)
> >          (preferences:set 'framework:square-bracket:cond/offset l2))))
> >
> > (A minor extension to the preferences could probably even do that
> > without writing the file.)
> >
> > --
> >          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
> >                    http://barzilay.org/                   Maze is Life!
> >

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the dev mailing list.