Re: [racket-dev] Closes PR 11062

2010-07-31 Thread Robby Findler
Right. It should be fixed now, tho.

Thanks,
Robby

On Fri, Jul 30, 2010 at 10:06 PM, Matthias Felleisen
matth...@ccs.neu.edu wrote:

 Robby, this fix does NOT change the problematic coverage of structures. 
 Fields are still colored as if they had never been evaluated.


 On Jul 30, 2010, at 1:16 PM, mfl...@racket-lang.org wrote:

 mflatt has updated `master' from 14de7399bd to 0e8af6bc5d.
  http://git.racket-lang.org/plt/14de7399bd..0e8af6bc5d

 =[ 1 Commits ]==

 Directory summary:
  93.3% collects/lang/private/
   6.6% collects/tests/racket/

 ~~

 0e8af6b Matthew Flatt mfl...@racket-lang.org 2010-07-30 11:04
 :
 | fix acc/mut error msgs from `define-struct' in teaching languages
 |  Merge to 5.0.1
 |  Closes PR 11062
 :
  M collects/lang/private/teach.rkt     |   42 ---
  M collects/tests/racket/advanced.rktl |    4 +++
  M collects/tests/racket/beg-adv.rktl  |    1 +

 =[ Overall Diff ]===

 collects/lang/private/teach.rkt
 ~~~
 --- OLD/collects/lang/private/teach.rkt
 +++ NEW/collects/lang/private/teach.rkt
 @@ -116,13 +116,13 @@
   (define-for-syntax (stepper-ignore-checker stx)
     (stepper-syntax-property stx 'stepper-skipto '(syntax-e cdr syntax-e cdr 
 car)))

 -  (define-for-syntax (map-with-index proc list)
 -    (let loop ([i 0] [list list] [rev-result '()])
 -      (if (null? list)
 +  (define-for-syntax (map-with-index proc . lists)
 +    (let loop ([i 0] [lists lists] [rev-result '()])
 +      (if (null? (car lists))
         (reverse rev-result)
         (loop (+ 1 i)
 -             (cdr list)
 -             (cons (proc i (car list)) rev-result)
 +             (map cdr lists)
 +             (cons (apply proc i (map car lists)) rev-result)

   ;; build-struct-names is hard to handle
   (define-for-syntax (make-struct-names name fields stx)
 @@ -855,16 +855,28 @@
                                                              ;; give 
 `check-struct-wraps!' access
                                                              
 (make-inspector)))

 -                                        #,@(map-with-index (lambda (i name)
 -                                                             #`(define 
 (#,name r)
 -                                                                 
 (raw-generic-access r #,i) ; error checking
 -                                                                 
 (check-struct-wraps! r)
 -                                                                 
 (raw-generic-access r #,i)))
 -                                                           getter-names)
 -                                        #,@(map-with-index (lambda (i name)
 -                                                             #`(define 
 (#,name r v)
 -                                                                 
 (raw-generic-mutate r #,i v)))
 -                                                           setter-names)
 +                                        #,@(map-with-index (lambda (i name 
 field-name)
 +                                                             #`(define 
 #,name
 +                                                                    (let 
 ([raw (make-struct-field-accessor
 +                                                                            
     raw-generic-access
 +                                                                            
     #,i
 +                                                                            
     '#,field-name)])
 +                                                                      
 (lambda (r)
 +                                                                        
 (raw r) ; error checking
 +                                                                        
 (check-struct-wraps! r)
 +                                                                        
 (raw r)
 +                                                           getter-names
 +                                                              fields)
 +                                        #,@(map-with-index (lambda (i name 
 field-name)
 +                                                             #`(define 
 #,name
 +                                                                    (let 
 ([raw (make-struct-field-mutator
 +                                                                            
     raw-generic-mutate
 +                                                                            
     #,i
 +                                                                            
     '#,field-name)])
 +                                                                      
 (lambda (r v)
 +                                                                        
 (raw r v)
 +                                                           setter-names
 +            

Re: [racket-dev] P4P: A Syntax Proposal

2010-07-31 Thread Jens Axel Søgaard
2010/7/31 Eli Barzilay e...@barzilay.org:

 There's a whole bunch of these things (in CL and Scheme), and IIRC,
 Jens had something very well doone recently -- but they all suffer
 from requiring some ugly wrapper syntax around them.

Indeed. In order to keep the wrapping at a minimum I contemplate
hijacking strings starting with $, that is, if a string starts with $ then
the remaining part of the string is parsed as an infix expression.
I came to my senses eventually.

http://planet.racket-lang.org/package-source/soegaard/infix.plt/1/0/planet-docs/manual/index.html

-- 
Jens Axel Søgaard
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Re: [racket-dev] Getting old versions of PLT Scheme

2010-07-31 Thread Eli Barzilay
On Jul 22, Carl Eastlund wrote:
 To fix a backwards compatibility bug, I just had to go download PLT
 Scheme 4.2.4.  It's a real pain to do so.  First, the Racket site
 doesn't seem to link to versions before 5.0.  I had to go to
 plt-scheme.org manually.  It'd be nice if I could get to the whole
 history in one place.  Second, at plt-scheme.org, the window is
 covered by a misshapen dialog telling me to go to the Racket site.  I
 have put a picture of the misshapen window up at
 http://www.ccs.neu.edu/home/cce/racket-dialog.png (this from Firefox
 3.6.2 on Intel Mac).  Third, it takes several clicks to get to the
 4.2.4 download, and at each click the dialog pops back up again.  Our
 site(s) would be easier to get around if any or all of these were
 fixed: old versions from the Racket Download page, an easier to read
 redirection dialog, and only seeing that dialog once per visit.

Patches welcome.  See revision 2715 of iplt on the svn repository for
where to change things.

(The bad text size is something that I couldn't find out how to fix
yet, and the one-warning-per-visit requires adding code that will use
a cookie.)

-- 
  ((lambda (x) (x x)) (lambda (x) (x x)))  Eli Barzilay:
http://barzilay.org/   Maze is Life!
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] using the Y combinator to...

2010-07-31 Thread Robby Findler
The use of the Y combinator (as opposed to the built-in forms of
recursion) seems to be hacking around the ability for Ruby methods to
be redefined more than anything?

Robby

On Sat, Jul 31, 2010 at 8:54 PM, Shriram Krishnamurthi s...@cs.brown.edu 
wrote:
 ...provide a mis-feature that the language thoughtfully left out:

 http://www.eecs.harvard.edu/~cduan/technical/ruby/ycombinator.shtml

 (The bit about lexical scoping in Ruby is also neat.  It says that
 deep down, Ruby really is the same as JavaScript and Python.)

 Shriram
 _
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev