mark.warren
2019-5-13 07:18:41

@alexander.m.cecile Hello


jerome.martin.dev
2019-5-13 07:34:56

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”.


jerome.martin.dev
2019-5-13 07:41:51

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.


d_run
2019-5-13 13:59:52

jerome.martin.dev
2019-5-13 14:18:10

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


pocmatos
2019-5-13 18:29:54

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.


justin.hu
2019-5-13 18:31:21

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?


alexknauth
2019-5-13 18:53:41

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


justin.hu
2019-5-13 18:53:58

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.


justin.hu
2019-5-13 18:55:28

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


alexknauth
2019-5-13 18:56:54

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])))


justin.hu
2019-5-13 18:57:20

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


justin.hu
2019-5-13 18:58:28

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


justin.hu
2019-5-13 18:59:10

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


alexknauth
2019-5-13 19:00:31

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


alexknauth
2019-5-13 19:01:27

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


justin.hu
2019-5-13 19:02:37

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


alexknauth
2019-5-13 19:07:33

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


mflatt
2019-5-13 19:49:13

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


alexknauth
2019-5-13 20:13:59

@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:


alexknauth
2019-5-13 20:15:18

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


justin.hu
2019-5-13 20:31:51

Thanks! This looks useful.