mflatt
2018-3-6 15:40:51

@dedbox Issue 1: How are you creating the evaluator for examples? If you make a sandbox evaluator, then the default is to create a new inspector, so results will be transparent outside the sandbox where they’re rendered. You can set sandbox-make-inspector to current-inspector to avoid that. Issue 2: Difficult to say without more information, but it’s possible that you’re using #, and it’s interpreted as an examples escape instead of a require syntax unquote. If that’s it, you use use #:escape to pick a different escape form.


dedbox
2018-3-6 16:07:54

@mflatt issue 1 resolved, and issue 2 is back on my radar. Thanks!


dedbox
2018-3-6 17:01:29

Is it possible for make-evaluator to require a submodule in the same file? This isn’t working: (module m racket) (parameterize ([sandbox-security-guard current-security-guard]) (make-evaluator 'racket #:requires '('m))) It gives require: unknown module module name: #<resolved-module-path:'m>


dedbox
2018-3-6 17:02:39

Setting all parameters to the trusted sandbox configuration values gives the same error


mflatt
2018-3-6 17:15:51

The 'm style to access a relative submodule only works in static positions, like require. For a dynamic context, like calling make-evaluator, you’ll need to provide an absolute module path. The quote-module-path form from syntax/location may be the right way to go.


dedbox
2018-3-6 20:49:57

@mflatt that did the trick! Now I can make Scribble MWEs.


dedbox
2018-3-6 20:56:47

Issue 2 resolved! I was using the #:lang argument instead of #:eval since yesterday.


dedbox
2018-3-6 20:57:04

:sweat_smile:


me1
2018-3-6 23:39:59

I like how with Python a multi-line string is easily formed with triple quotes: str = “”"multiple lined string”“” I’ve been using heredocs with Racket: (define str #<<EOF multiple lined string EOF ) but that’s a lot less elegant (IMHO), and more syntax-y (meaning less obvious what’s going on).


me1
2018-3-6 23:40:06

Is there a better way to do multi-line strings in Racket? Perhaps a way to map the heredoc behavior to triple quotes?


githree
2018-3-6 23:42:52

@me1 I personally prefer to use at-exp reader for that


githree
2018-3-6 23:43:20
@~a{first line
second line
third line}

githree
2018-3-6 23:44:43

@~a will give you what you need once at-exp is enabled


githree
2018-3-6 23:48:12

here is a nice overview of what you can do with at-exp in regards to strings: http://www.greghendershott.com/2015/08/at-expressions.html


dedbox
2018-3-7 00:19:48

those regexps look very perly


me1
2018-3-7 00:22:05

Thanks. I’ll try to get it working better with SublimeREPL in Sublime Text (my main environment). That is, “#lang” doesn’t work it seems.


me1
2018-3-7 00:22:51

I do like the triple-quote method, too; is there a simple way to replicate that behavior?


me1
2018-3-7 00:23:55

The reason being that sometimes when I’m editing the company wiki I want to parse a copy-pasted bit and run a script on the string really quickly, and every complication slows things. :disappointed:


dedbox
2018-3-7 00:27:27

That would be a reader extension, I think


dedbox
2018-3-7 00:27:44

(chapter 17 in the Racket Guide)


githree
2018-3-7 00:48:50

@me1 probably reader extension is the way as @dedbox said, as to your #lang not working - to set up racket to use different language you would start your racket with the following command e.g.: racket -I typed/racket


githree
2018-3-7 00:49:40

the problem is I don’t know how to add the reader extension so it would work: racket -I at-exp racket doesn’t work


me1
2018-3-7 00:55:04

hmmm


me1
2018-3-7 00:56:24

for right now at least I made a macOS Keyboard Maestro macro: (define x KEYBOARD_MAESTRO_MACRO[#<<EOF {{paste}} EOF ) ]


me1
2018-3-7 00:56:56

still not quite as elegant as something like triple quotes, though, since in files themselves all the heredocs are very syntax-y


githree
2018-3-7 00:58:06

triple quotes would also “work” here :wink: : (define multi-line #&lt;&lt;""" Some multi-line string literal. """ )


me1
2018-3-7 01:26:58

hmmm, great point!


greg
2018-3-7 02:48:31

added :emacs: and :racket-flat: emojis