On Wed, Aug 17, 2011 at 9:10 AM, Sam Tobin-Hochstadt wrote:
> On Wed, Aug 17, 2011 at 9:42 AM, Norman Gray wrote:
>> Don't you mean "C must be a subtype of A", here?
>
> Yes, definitely. It's hard to get math right in prose. :)
>
Pretty hard to get right in LaTeX too.
Thanks!
On Wed, Aug 17, 2011 at 7:23 AM, Matthew Flatt wrote:
> This is now fixed.
>
> At Wed, 17 Aug 2011 05:59:06 -0500, Casey Klein wrote:
>> 2011/8/16 Casey Klein :
>> > Running this program:
>> >
>> > #lang racket/base
>> >
2011/8/16 Casey Klein :
> Running this program:
>
> #lang racket/base
>
> (define binder #'x)
> (define bound #'x)
>
> (syntax-case (parameterize ([current-namespace (make-base-namespace)])
> (expand `(λ (,binder) ,bound)))
> ()
>
Running this program:
#lang racket/base
(define binder #'x)
(define bound #'x)
(syntax-case (parameterize ([current-namespace (make-base-namespace)])
(expand `(λ (,binder) ,bound)))
()
[(_ (_ (binder) bound))
`([binder ,(syntax-original? #'binder)]
[b
On Tue, Aug 16, 2011 at 9:15 AM, Matthew Flatt wrote:
> At Mon, 15 Aug 2011 13:18:07 -0600, Matthew Flatt wrote:
>> Forms like `racketblock' and `racketinput' have `RACKETBLOCK' and
>> `RACKETINPUT' variants that use `UNSYNTAX' as the escae form, instead,
>> but I never got around to `examples', e
Could someone explain why the program below raises a syntax error?
The error goes away if you make either of the following changes:
1. enable errortrace, or
2. change `syntax' to `quote' in the `expand' argument.
#lang racket/load
; Change #1
;(require errortrace)
(module t racket
(pro
Compiling the following Scribble program complains that x is unbound
on the last line:
#lang scribble/doc
@(require scribble/eval)
@examples[#:eval (make-base-eval)
(define x #'q)
#`(a #,x c)]
Of course, it is unbound in the expression doing the eval-ing, but
that shouldn't
On Fri, Aug 12, 2011 at 10:44 AM, Danny Yoo wrote:
> Kent Dybvig's tutorial on syntax case was helpful for me:
>
> http://www.cs.indiana.edu/~dyb/pubs/tr356.pdf
>
I second that recommendation. It was a huge help to me when learning
to write macros in Racket.
__
On Fri, Aug 12, 2011 at 9:22 AM, Neil Van Dyke wrote:
> 1. Without trying it, I'm pretty sure this particular syntax transformation
> can be done in "syntax-rules", but I'm not certain it can be done using only
> the power of "..." in "syntax-rules", without a helper macro. Your life
> might be e
On Fri, Aug 12, 2011 at 7:39 AM, Robby Findler
wrote:
> Unfortunately, that position in a 'case' expression is not a place
> where macro expansion happens. You can, however, use a 'cond' instead
> of 'case'.
>
But you still can't use a macro like `process-state' to generate an
entire `cond' claus
On Fri, Aug 12, 2011 at 7:26 AM, Jay McCarthy wrote:
> 2011/8/11 Racket Noob :
>>
>> (define-syntax automaton
>> (syntax-rules (: -> END)
>> [(_ init-state
>> (state : transition ...)
>> ...)
>> (letrec ([curr-state empty]
>> [state
>> (lambd
On Thu, Aug 11, 2011 at 9:03 AM, Robby Findler
wrote:
>
> Matthew recently wrote an excellent note about the interactions with
> eval and namespaces and why you should or shouldn't use one and I
> would love to be able to provide you with the same, but I don't have
> such an essay yet. I'm sorry.
On Mon, Jul 25, 2011 at 11:20 PM, David Van Horn wrote:
>
> Cute! Thanks for the cool planet package. Here's a slightly larger example
> using Redex, adapted from redex/examples/arithmetic.rkt:
>
> #lang planet asumu/sweet racket
> require rename-in(redex [term quote])
>
> define-language lang
>
Scaling:
Use the pict library to scale the result of a non-file call to
render-reduction-relation. Here's an example (though there may be a
simpler way to get EPS):
(require redex
redex/examples/r6rs/r6rs
file/convertible
slideshow/pict)
(define (render-reduction-relat
On Wed, May 4, 2011 at 12:25 AM, Stephen Chang wrote:
> When using Redex, for the traces nodes, is there any way to specify
> how to color the text in each node? For example, I want to be able to
> quickly identify the redex in each step by giving it a different
> color. I looked in the docs and i
On Tue, Apr 5, 2011 at 4:54 PM, Charles Hixson
wrote:
> When it comes to Scheme/Lisp I'm nearly a total newbie. So that page didn't
> mean anything to me. Perhaps some examples would have made it clear what it
> was talking about, but also perhaps not. (I *really* didn't understand it.)
>
Here
On Fri, Apr 1, 2011 at 7:45 AM, Matthew Flatt wrote:
> At Fri, 1 Apr 2011 04:10:19 -0500, Casey Klein wrote:
>> What exactly is in the `id' field of a `exn:fail:contract:variable'
>> structure? It doesn't seem to be the symbolic name of the
>> not-yet-defined
What exactly is in the `id' field of a `exn:fail:contract:variable'
structure? It doesn't seem to be the symbolic name of the
not-yet-defined variable.
#lang racket
(define-syntax (m stx)
(syntax-case stx ()
[(_ x)
(let ([y (datum->syntax #'fresh (syntax-e #'x) #'x)])
#`(begin
On Sun, Mar 20, 2011 at 4:58 PM, Gregory Woodhouse wrote:
> If I write a trivial loop using call/cc
>
> (call/cc
> (lambda (k)
> (define (loop)
> (let ([x (read)])
> (if (eq? x '())
> (k x)
> (loop
> (loop)))
>
> It does exactly what I expect. If I type anyth
On Fri, Mar 18, 2011 at 7:11 AM, Robby Findler
wrote:
> On Fri, Mar 18, 2011 at 6:46 AM, Pierpaolo Bernardi
> wrote:
>> Could \tilde be added to the list of keyboard macros recognized by M-\ ?
>
> It is called \sim.
>
But \sim + M-\ does not produce the same character that ~ produces on
my keyb
On Wed, Jan 26, 2011 at 1:41 PM, John Clements
wrote:
>
> On Jan 26, 2011, at 4:29 AM, Casey Klein wrote:
>
>> On Wed, Jan 26, 2011 at 1:27 AM, John Clements
>> wrote:
>>> I would expect this program to signal an error:
>>>
>>> #lang lazy
>&
On Wed, Jan 26, 2011 at 1:27 AM, John Clements
wrote:
> I would expect this program to signal an error:
>
> #lang lazy
>
> (define zeros (cons 0 zeros))
>
> (define should-be-error (list-ref (take 15 zeros) 1324))
>
>
> ... but instead should-be-error is bound to zero. How can I take the 1000th
On Tue, Jan 25, 2011 at 1:35 PM, Mark Engelberg
wrote:
> This program:
>
> #lang racket
> (require (planet dyoo/moby:3:9))
>
> gives me this error:
>
> ..\..\Documents and Settings\Mark\Application
> Data\Racket\planet\300\5.0.2\cache\dyoo\js-vm.plt\1\12\private\translate-bytecode-structs.rkt:25:
On Sat, Jan 15, 2011 at 12:49 AM, Eric Dobson wrote:
> I was looking at the documentation on how continuation-marks work, and
> the documented behavior is different than what I observed.
>
> The following programs add a continuation mark, then a prompt, then
> try to look at the current continuati
On Thu, Jan 6, 2011 at 11:14 AM, Keiko Nakata
wrote:
> So, I fall back into the same question of why 'raise' has to be a primitive,
> given
My totally uninformed guess is that it's because there are
C-implemented primitives that need to raise exceptions, and it's
easier for those primitives to ca
On Thu, Jan 6, 2011 at 10:08 AM, Keiko Nakata
wrote:
> On Thu, Jan 6, 2011 at 3:20 PM, Casey Klein
> wrote:
>> > Still I am not certain that this behavior of 'raise' cannot be implemented
>> > by other (delimited) control operators. And, probably I do not sti
On Thu, Jan 6, 2011 at 10:15 AM, Robby Findler
wrote:
> On Thu, Jan 6, 2011 at 10:11 AM, Keiko Nakata
> wrote:
>> On Thu, Jan 6, 2011 at 3:29 PM, Robby Findler
>> wrote:
>>
>>> If you wanted to try, I'd suggest adapting the redex model and then
>>> using random testing to try to find the differ
On Thu, Jan 6, 2011 at 7:18 AM, Keiko Nakata wrote:
>> I'm not completely clear, but I think the only point is that 'raise'
>> does not, in general, actually abort. It calls a handler that makes
>> the decision to abort or not. When aborting actually happens, however,
>> abort is what does the abo
On Thu, Jan 6, 2011 at 6:32 AM, Keiko Nakata wrote:
>> I don't think you could rebuild the
>> missing portion of the continuation by reinstalling it before calling
>> the exception handler due to dynamic-wind frames, which could notice
>> the exit and re-entry, and continuation barriers, which cou
On Wed, Jan 5, 2011 at 8:55 AM, Keiko Nakata wrote:
>> A `with-handlers' handler and a `call-with-exception-handler' handler
>> are invoked with different continuations. A `with-handlers' handler is
>> invoked with the continuation of the entire `with-handlers'
>> expression; a `call-with-exceptio
On Wed, Jan 5, 2011 at 8:22 AM, Keiko Nakata wrote:
>> raise just calls a handler that is the one that does the interesting
>> control.
>
> So having separate implementations is for optimization?
>
I don't think `raise' can be defined via `abort'. `raise' calls the
exception handler in the curren
On Wed, Jan 5, 2011 at 7:40 AM, Keiko Nakata wrote:
> Thanks for the code.
>
> I'm a bit confused as replacing 'call-with-exception-handler' by
> 'with-handlers' seem to not produce the same bahavior:
>
> (call-with-continuation-prompt
> (lambda ()
> (with-handlers
> ([(lambda (_) true) (lambd
On Wed, Jan 5, 2011 at 6:32 AM, Keiko Nakata wrote:
> Hello,
>
> Will someone give me an example which shows the continuation barrier
> introduced by 'raise'? I.e., I want an program which raises an exception
> because of the barrier.
>
> I think I do not understand the documentation properly,
>
On Sat, Dec 25, 2010 at 1:48 AM, Scott McLoughlin wrote:
> Couldn't find docs on this syntax form using regular
> docs search.
>
I don't know how to find it with search either, but here it is.
http://docs.racket-lang.org/reference/reader.html#%28part._parse-pair%29
"If the reader finds three or
On Fri, Dec 24, 2010 at 2:56 PM, Neil Van Dyke wrote:
> Casey Klein wrote at 12/24/2010 03:42 PM:
>>
>> Adding `let:' to the list of "Lambda-like Keywords" in DrRacket's
>> "Editing" preferences makes your first two examples indent as in
On Wed, Dec 22, 2010 at 6:28 PM, Neil Van Dyke wrote:
> DrRacket 5.0.2 isn't indenting Typed Racket "let:" forms idiomatically. It
> indents them in the default way rather than a special way like it does for
> Racket "let" forms.
>
> In case anyone wants to fix this, here's how Quack currently in
I'd like to rework Redex's `define-language' form to use syntax-parse,
but I'm having trouble getting the error message I want.
Here's the best I've been able to do (for a simplification of
`define-language'):
(define-syntax (define-language stx)
(syntax-parse stx
[(_ lang:id (nt:id (~descr
On Fri, Sep 10, 2010 at 11:40 AM, John Clements
wrote:
>
> On Sep 10, 2010, at 9:34 AM, Matthew Flatt wrote:
>
>> At Fri, 10 Sep 2010 09:21:28 -0700, John Clements wrote:
>>> I've spent long enough with the docs on this not to feel too embarrassed
>>> about
>>> this question: what kind of value i
On Wed, Sep 8, 2010 at 10:36 AM, Eric Tanter wrote:
> Hi,
>
> Is there a way to have the (define ...) dropdown button be customized for
> define-metafunction, so that it displays the name of the metafunction instead
> of just showing the language name?
>
The dropdown menu assumes that the first
On Wed, Jul 7, 2010 at 10:53 PM, Jay McCarthy wrote:
> How should I use Redex to encode a structured semantics... For example,
>
> Suppose I have the L_thread language and the ->_thread reduction
> relation with contract
>
> (store_global store_local term) ->_thread (store_global store_local term)
On Fri, Jun 4, 2010 at 1:48 PM, Casey Klein
wrote:
> On Fri, Jun 4, 2010 at 1:14 PM, Eric Tanter wrote:
>> Hi,
>>
>> I have a subtype? metafunction where one clause is as follows:
>>
>> ((subtype? C_0 C_1 CT)
>> #t
>> (side-condition (not (equal?
41 matches
Mail list logo