Re: [racket-users] confused about raco check-requires error

2017-11-21 Thread Ryan Culpepper

On 11/21/17 2:57 AM, Alex Harsanyi wrote:

I'm trying to use the "raco check-requires" command to determine which
requires I should remove from my source files, and the command fails when I
include one of my files (the application compiles and runs fine).

I managed to reproduce the case as follows:

;; Save this in "file1.rkt"
#lang racket/base
(require racket/class)

(define foo%
  (class object%
(init-field name)
(super-new)
))

(provide foo%)

;; Save this in "file2.rkt"
#lang racket/base
(require "file1.rkt")

When running check requires ("raco check-requires file2.rkt"), I would
expect
that "file1.rkt" to be reported as a useless include, instead I get the
following error:

$ raco check-requires file2.rkt
derivation-parser: error on token #280:  .
#)>
(file "file2.rkt"):
ERROR in (file "file2.rkt")

Interestingly, if I compile the files using "raco make file2.rkt", the
check-requires command works fine:

$ raco make file2.rkt
$ raco check-requires file2.rkt
(file "file2.rkt"):
DROP "file1.rkt" at 0

Could someone clarify what is "check-requires" complaining about in the
first
case?  Is this command only supposed to be run after the code was compiled?


That's an internal error in the implementation of check-requires, which 
reuses parts of the macro stepper. When compiled/file1_rkt.zo doesn't 
exist, expanding file2.rkt causes file1.rkt to be compiled (but not 
saved as a .zo file). Macro stepper "events" are supposed to be emitted 
in expand mode but not in compile mode, but during the compilation of 
file1.rkt, some events are getting emitted anyway (that's the real bug), 
and that confuses the event parser.


I've committed a workaround that should fix this particular problem, but 
the underlying problem will probably be more difficult.


Ryan

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] confused about raco check-requires error

2017-11-20 Thread Alex Harsanyi
I'm trying to use the "raco check-requires" command to determine which
requires I should remove from my source files, and the command fails when I
include one of my files (the application compiles and runs fine).  

I managed to reproduce the case as follows:

;; Save this in "file1.rkt"
#lang racket/base
(require racket/class)

(define foo%
  (class object%
(init-field name)
(super-new)
))

(provide foo%)

;; Save this in "file2.rkt"
#lang racket/base
(require "file1.rkt")

When running check requires ("raco check-requires file2.rkt"), I would 
expect
that "file1.rkt" to be reported as a useless include, instead I get the
following error:

$ raco check-requires file2.rkt
derivation-parser: error on token #280:  . 
#)>
(file "file2.rkt"):
ERROR in (file "file2.rkt")

Interestingly, if I compile the files using "raco make file2.rkt", the
check-requires command works fine:

$ raco make file2.rkt
$ raco check-requires file2.rkt
(file "file2.rkt"):
DROP "file1.rkt" at 0

Could someone clarify what is "check-requires" complaining about in the 
first
case?  Is this command only supposed to be run after the code was compiled?

Thanks,
Alex.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.