
oh, nice technique!

@bmitchell33 Also except-in

@khepin thanks for the article, really interesting!

it was fun to build too

Is this supposed to generate no output? #lang racket
(require slideshow)
(para "
I disappear!
Where are you?")

Do you mean for that to be in a slide form?

No, just in the repl. Compare with:

(para "I disappear!
Where are you?")

Here the second line disappears.

Bigger picture: I was looking for a function that converts a multi line string into a pict.

Hey @robby, the changes you made to text-first-line.rkt
seem to cause drracket to crash on any file long enough to make drracket scroll.

The error in particular being: send: no such method
method name: do-draw-single-line
class name: add-on-paint-logging
context...:
/home/leif/racket/racket/collects/racket/private/class-internal.rkt:4679:0: obj-error34
/home/leif/rsrc/gui/gui-lib/framework/private/text-first-line.rkt:147:6: on-paint method in first-line-mixin
/home/leif/rsrc/drracket/drracket/drracket/private/unit.rkt:815:10: on-paint method in ...ket/private/unit.rkt:557:8
/home/leif/rsrc/drracket/drracket/drracket/private/module-language.rkt:2630:6: on-paint method in mk-module-language-text-mixin236
/home/leif/rsrc/drracket/drracket/drracket/private/syncheck/blueboxes-gui.rkt:323:4: on-paint method in docs-text-gui-mixin
/home/leif/rsrc/drracket-vim-tool/private/text.rkt:243:6: on-paint method in vim-emulation-mixin
/home/leif/rsrc/drracket/drracket/gui-debugger/debug-tool.rkt:500:8: on-paint method in debug-definitions-text-mixin186
/home/leif/rsrc/gui/gui-lib/framework/private/logging-timer.rkt:41:0: log-timeline/proc
...higher-order.rkt:375:33
/home/leif/rsrc/gui/gui-lib/mred/private/wxme/text.rkt:5381:18: paint-done
/home/leif/rsrc/gui/gui-lib/mred/private/wxme/text.rkt:5202:2: refresh method in text%
/home/leif/rsrc/gui/gui-lib/mred/private/wxme/editor-canvas.rkt:628:2: redraw method in editor-canvas%
/home/leif/rsrc/gui/gui-lib/framework/private/text-first-line.rkt:119:6: after-scroll-to method in first-line-mixin
/home/leif/rsrc/drracket/drracket/drracket/private/module-language.rkt:2667:6: after-scroll-to method in mk-module-language-text-mixin236
/home/leif/rsrc/drracket/drracket/drracket/private/syncheck/blueboxes-gui.rkt:296:4: after-scroll-to method in docs-text-gui-mixin
/home/leif/rsrc/drracket-vim-tool/private/text.rkt:191:6: after-scroll-to method in vim-emulation-mixin
...

Also in (para "I \n disappear!" "Where are you?")
I see the “I ” and the “Where are you?” but the rest is gone.

@leif I’m not seeing that, but I may not be up to date. Let me rebuild

oic.

yes indeed.

@leif I’ve pushed a fix. Thanks.

@dimitri.lozeve has joined the channel

(not sure if you get notified about replies or not on slack, still new to it, so I’ll ping you just in case @philip.mcgrath)

This guy needs some help: https://www.reddit.com/r/Racket/comments/cpvajq/parsing_configuration_files/

Yeah, the State
thing is gone since https://github.com/stchang/parsack/commit/ca5b180574712cf0320ef795bf6bd057ecba417e

Racket dependencies don’t usually include version number, unlike package.json
/ package-lock.json
for JS

which is unfortunate

Might be misunderstanding something, but the documentation seems to state that delete-directory/files
is part of base
(presuming racket/base
?). Using #lang racket
includes it but #lang racket/base
does not. <https://docs.racket-lang.org/reference/Filesystem.html#%28def._%28%28lib._racket%2Ffile..rkt%29._delete-directory%2Ffiles%29%29>

Okay guess that won’t hyperlink then. https://docs.racket-lang.org/reference/Filesystem.html#%28def._%28%28lib._racket%2Ffile..rkt%29._delete-directory%2Ffiles%29%29

@willbanders No, it’s in racket/file

If you scroll up, you’ll see that it’s listed under the section: 15.2.6 More File and Directory Utilities

On long doc pages that contain stuff from different modules, this can be pretty hard to notice.

What does it mean by Changed in version 7.0 of package base: Added Windows-specific file deletion.
?

It’s referring to that last paragraph about what it does differently on Windows.

Before that version presumably it didn’t do that.

package base
?

Oh, sorry — yeah, just got that

np xD

I think that’s a mistake

Alrighty, one final question and I think I’m done. How do I compare a path x
with the parent of path y
? Essentially, I want to know if x
directly contains y
. In this particular case y
is a file, so I want to test if it’s in a given directory.
I found path-only
on the docs, but the format seems a bit off - it return a path that prints as root/dir/
, while the path I have for the directory prints as root/dir
(no trailing slash).

This was fixed by adding a trailing \\
to paths for directories. (build-path root "dir")
is a directory, but not equivalent to (build-path root "dir\\")
in terms of equality and the behavior of path-only
. This is a bit annoying and unexpected behavior.

@willbanders does this (or some variant of it) work: (equal? (simplify-path x)
(simplify-path (build-path y 'up)))

It does, but still requires the trailing \\
.

Haven’t found anything to get the name of a directory yet, file-name-from-path
only works on files. I thought I could get the last path element and use path-element->string
, but there doesn’t seem to be a way to do that either. I don’t understand why this is so convoluted.

path-element->string
says it’s generally the best method for getting a directory name, but fails on split because the path is not relative.

@willbanders The base
package is not the same as the racket/base
module—a “package” is a unit of distribution (something you can install with raco pkg
) while a “module” is a thing you can require
. The base
package is the package containing all the stuff that’s a part of Minimal Racket, including everything in #lang racket
, various modules in the syntax/
collection, a handful of modules in the net/
collection, and a grab bag of other things needed to implement the core of Racket.

You can see the full list here: https://github.com/racket/racket/tree/master/racket/collects

also “collection” is another thing

For most purposes, a “collection” can be approximated as the analog of a “directory” in a module path, e.g. racket/
, syntax/
, net/
, etc.

A single collection can actually correspond to several different directories on-disk, though.