[racket] extract text?

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Nov 1 12:40:30 EDT 2010

I once wrote a script that does that -- you can find it at
barzilay.org/hacks.html -- but it might need some dusting.  It
precedes `wxme-port->whatever', and does some more work in an attempt
to produce some text that is close to the original wxme file.

But if you're using the handin server, then you can put some flags in
the checker files and it will create a text versions whenever a file
is submitted.  That makes things much more convenient, since you can
even make it reject submissions with non-textual items, if you want to
be able to have a text file that is exactly the same as the student
submissions.


About a minute ago, Robby Findler wrote:
> That will eliminate the non-text things. If you want to do things with
> those, you can create a text% object and use load-file and then
> manipulate the editor in lots of ways. That's the general thing.
> 
> You could ause use wxme-port->port, which is kind of inbetween the
> other two ways.
> 
> It really depends on what you want to do with the files. Print them?
> Run grading scripts?
> 
> Robby
> 
> On Mon, Nov 1, 2010 at 11:28 AM, Jon Rafkind <rafkind at cs.utah.edu> wrote:
> > I think
> >
> > wxme-port->text-port
> >
> > http://docs.racket-lang.org/gui/WXME_Decoding.html?q=wxme&q=snip&q=snip#(def._((lib._wxme/main..rkt)._wxme-port-~3etext-port))
> >
> > is what you want
> >
> > On 11/01/2010 10:25 AM, Adam Shaw wrote:
> >
> > Hi all --
> > I'm grading a lot of racket files this quarter. A question: is there a
> > widget to extract the text from a .rkt file?
> > In other words, we'd like less of this
> >
> > 0 0 14 3 3 #"num"
> > 0 0 22 3 1 #")"
> > 0 0 128 3 1 #" "
> > 0 0 14 3 3 #"num"
> > 0 0 22 3 1 #"]"
> > 0 0 128 29 1 #"\n"
> > 0 0 128 3 4 #"    "
> > 0 0 22 3 1 #"["
> >
> > and more of this
> >
> > (if (foo x) y z)
> >
> > at least for grepping and other such occasional tasks.
> > Regards,
> > Adam
> >
> >
> >
> >
> > _________________________________________________
> >   For list-related administrative tasks:
> >   http://lists.racket-lang.org/listinfo/users
> >
> > _________________________________________________
> >  For list-related administrative tasks:
> >  http://lists.racket-lang.org/listinfo/users
> >
> _________________________________________________
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/users
-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.