soegaard2
2020-8-15 14:10:32

@jestarray Maybe blank ?


spdegabrielle
2020-8-15 16:32:56

Is there an equivalent of the bash \ in racket that ignores new lines ?


soegaard2
2020-8-15 16:33:47

Doesn’t work?


soegaard2
2020-8-15 16:33:55

(I can’t remember)


soegaard2
2020-8-15 16:34:25

Or am I thinking of here-strings?


laurent.orseau
2020-8-15 16:34:25

Yes it does


spdegabrielle
2020-8-15 16:34:56

oh no - i mean in at-exp!


laurent.orseau
2020-8-15 16:34:57

Herestring: #<<EOS some line some other line EOS


laurent.orseau
2020-8-15 16:36:09

No, doesn’t work in at-exp. You’ll have to escape to sexp strings


spdegabrielle
2020-8-15 16:36:13

#lang at-exp racket/gui @string-append{ Lorum ipsum\ dolor emet\ }


laurent.orseau
2020-8-15 16:36:53

That won’t work


soegaard2
2020-8-15 16:37:25

(slightly slower, but I often use ~a instead of string-append when using at-exp.)


laurent.orseau
2020-8-15 16:37:58

or rename string-append


spdegabrielle
2020-8-15 16:39:00

I still get "Lorum ipsum\ndolor emet"


spdegabrielle
2020-8-15 16:39:18

from #lang at-exp racket/gui @~a{ Lorum ipsum dolor emet }


soegaard2
2020-8-15 16:39:52

How about: #lang at-exp racket/gui @~a["Lorum ipsum\ dolor emet\ "]


spdegabrielle
2020-8-15 16:39:57

weirdly the first \n is missing?


spdegabrielle
2020-8-15 16:41:11

nice


soegaard2
2020-8-15 16:41:51

With [" "] the standard string-reader is used. With {} the at-exp reader is used.


spdegabrielle
2020-8-15 16:42:17

ahh


mflatt
2020-8-15 16:42:54

You can use the line-comment form @; to consume a newline: #lang at-exp racket/base @string-append{ Lorum ipsum@; dolor emet@; }


soegaard2
2020-8-15 16:43:44

Nice trick.


spdegabrielle
2020-8-15 16:44:33

very nice.


spdegabrielle
2020-8-15 16:48:34

ahh found it



spdegabrielle
2020-8-15 16:49:42

! @foo{bar @; comment baz@; blah}


alexharsanyi
2020-8-16 00:48:13

I did not have time to test it out, but, as far as I understand it, when the plot functions are exported using unsafe-provide, the contracts on the function parameters are discarded. This is mitigated in the code by adding checks for some, but not all the arguments. #:title for example is not checked, so if you pass a number as the title, the error is a contract fail on get-text-extent inside the plot package. With my changes, if you pass a number, it will now crash, presumably because the internal code paths have changed. The solution is to check the type of all the arguments for the plot functions.


samth
2020-8-16 00:52:38

Yes, that sounds like I missed #:title and probably other things when I added unsafe-provide


alexharsanyi
2020-8-16 01:03:35

I will fix that when I finish the pull request.