
@alexander.m.cecile Hello

Once I received a package on which someone had conscientiously hand-written my name as “Jérôme”. This person may have found my name a bit exotic, or may have thought something like “ah, those Europeans, they can’t pick a name without being fancy”.

This happens fairly regularly on websites when you happen to feature non-ascii characters in your name, but this was the first time someone had took the time to copy it by hand on a piece of paper.


Nice use of 2dcond :smile: すごい!

Has anyone been using cs-only
build? If I use make cs
, it will clone ChezScheme if needed. However with make RACKET=... cs-only
, I have to manually do it. I am happy with this, but wondering if this is on purpose or an oversight.

I’m trying to create a new syntactic forms for use in teaching: a new syntactic form called @tag
. It takes an identifier, and depending on the identifier, draws an arrow to some part of the next define. For example, if I had (@tag cond)
, then an arrow would be drawn between the cond
and the outermost cond expression of the next define
. However, to add a syntax arrow, I’d have to have access to the origin of the arrow (which I do), and the destination, which I don’t. How should I get the syntax object for the next define after some expression? Is this even the right approach - should I be extending check-syntax itself?

I’m not sure what you mean @justin.hu. Can you give more context around the (@tag cond)
example?

For the following file: (@tag cond)
(define (foo x)
(cond [(number? x) x]
[else x]))
I would like to draw an arrow between the cond in the (@tag cond)
and the cond in the definition of foo.

But, I don’t want to draw an arrow to anything after the body of foo
.

How would the @tag
form be able to control the body of foo
but not affect everything else after it?
Would something different like this make more sense? (with-@tag cond
(define (foo x)
(cond [(number? x) x]
[else x])))

That would make sense, but it is not very comfortable for students to use.

If only I had the syntax object for the whole file, I could read through each individual top level expression and add arrow properties.

I want to minimise the additional syntax on the student-facing side.

If you had control of the language they were using you could define a #%module-begin
to add the arrow properties

Or you could have it turn sequences of (@tag ...1...) ...2...
into (with-@tag ...1... ...2...)
.

I think I’ll look into extending the 2htdp languages. Thanks for the advice!

Or here’s another idea, if you don’t have control over the language but you can re-define define
, you could still use mutable-state to communicate between the @tag
form and the define
form. Not ideal to have to resort to that though

The cs-only
target isn’t intended to be public. You can use RACKET=...
with make cs
.

@justin.hu I’ve looked into this a bit more, and come up with this using mutable state to communicate between a @tag
macro and a define
macro:

Using this, the code: (@tag cond)
(define (foo x)
(cond [(number? x) x]
[else x]))
draws an arrow from the first cond
within @tag
to the second cond
within define

Thanks! This looks useful.