Hi Mark !
I just wrote a book on teaching Racket programming (in French !) with a chapter
15 devoted to LeX/Yacc parsing. Rather simple, but should be efficient for the
first steps.
Here is the table of contents :
http://deptinfo.unice.fr/~roy/PCPS/sommaire.pdf
-jpr
___
(a ([href ,what-you-have]) "link text")
Jay
On Tue, Oct 12, 2010 at 3:29 PM, Mark Carter wrote:
> I thought I'd try to implement a stateful counter web app using DrRacket.
> Here's
> my code:
>
> #lang racket
>
> define a really simply counter
>
>
> ;;; required libraries
> (require web-se
I thought I'd try to implement a stateful counter web app using DrRacket.
Here's
my code:
#lang racket
define a really simply counter
;;; required libraries
(require web-server/formlets
web-server/servlet
web-server/servlet-env)
(define (counter request)
(let ((coun
2010/10/12 Jens Axel Søgaard :
> Syntax/parse looks great!
>
> I haven't played with it before, but it I like the approach.
> Two questions:
>
> 1. What does the error
> pattern: attribute has wrong depth (expected 0, found 1) in: d
> mean? The program belows gives this error.
I f
On Tue, Oct 12, 2010 at 11:12 AM, Mark Carter wrote:
> Are there any examples on using lex and yacc, as I'm having trouble getting
> started. I am trying to write a simple calculator. Here's what I've got so
> far:
>
> #lang racket/base
>
> (require parser-tools/lex)
>
> (define lex (lexer
>
I like the recipe. May I suggest some additions:
1. Formulate a purpose statement.
2. Write down a grammar for the surface syntax.
3. Describe the semantics informally, along the lines of what a ref man would
contain.
Then follow the steps below. And yes, syntax-parse über alles. -- Matt
The documentation:
http://docs.racket-lang.org/parser-tools/Converting_yacc_or_bison_Grammars.html
says:
"Annotated examples are in the "examples" subdirectory of the
"parser-tools" collection."
That is online here:
http://git.racket-lang.org/plt/tree/HEAD:/collects/parser-tools/examples
Jay
Are there any examples on using lex and yacc, as I'm having trouble getting
started. I am trying to write a simple calculator. Here's what I've got so far:
#lang racket/base
(require parser-tools/lex)
(define lex (lexer
((:+ "[0-9]") (values 'int (string->number lexeme)))
Peter could roll his own in-directory recursive function in just a few line
catching the relevant exceptions:
> (define (traverse d)
> (parameterize ([current-directory d])
> (define d (directory-list))
> (for-each (lambda (x)
> (printf "~a " x)
> (defi
Syntax/parse looks great!
I haven't played with it before, but it I like the approach.
Two questions:
1. What does the error
pattern: attribute has wrong depth (expected 0, found 1) in: d
mean? The program belows gives this error.
2. Why is datum not a pre-defined syntax-cl
At Tue, 12 Oct 2010 14:48:49 +0100, Peter Kiggins wrote:
> [I am completely new to both Scheme and racket, so if my questions are
> Looking at traversal of a file tree led me to in-directory. The
> problem is that as soon as it hits a directory it cannot search
> (permissions, whatever...) it drop
hello
I have made kind of calculator
as like following code
#lang scheme
(define ns (make-base-namespace))
(define (calc)
(let ((expression (read)))
(if (eq? expression 'exit)
(exit)
(printf "~A ~n" (eval expression ns
(calc))
(calc)
since I learned big-bang function,
I
[I am completely new to both Scheme and racket, so if my questions are
easily answered by reading some documentation, please just point me at
it.]
Looking at traversal of a file tree led me to in-directory. The
problem is that as soon as it hits a directory it cannot search
(permissions, whatever
The Chipmunk API has changed since the package was written. You'll have to
go back an older version. Probably one from last summer.
Jay
On Mon, Oct 11, 2010 at 11:56 PM, 장유현 wrote:
> I'll really happy if someone help me..
>
> My environment is Windows XP. and I downloaded Chipmunk 5.3.2
>
> an
syntax/parse! :)
Robby
On Tue, Oct 12, 2010 at 3:46 AM, Jens Axel Søgaard
wrote:
> There have now been several solutions to the macro exercise.
> Is there a systematic approach of deriving a solution?
>
> Here are some steps that could be included in a macro writing recipe.
>
> 1. Write some e
There have now been several solutions to the macro exercise.
Is there a systematic approach of deriving a solution?
Here are some steps that could be included in a macro writing recipe.
1. Write some examples with their expected results.
Remember corner cases
(Get to know the semantics
16 matches
Mail list logo