wanpeebaw
2021-2-5 08:04:09

In the same file.


laurent.orseau
2021-2-5 08:53:49

You need https://docs.racket-lang.org/guide/hash-reader.html\|#reader: racket code ... #reader<your-reader.rkt>...code to be read by your-reader... ...racket code cont'd...


laurent.orseau
2021-2-5 08:56:38

DrRacket prefs could have a text field or a slide bar to adjust the number of spaces, between 1 and 8 maybe


gknauth
2021-2-5 09:56:09

I thought ~ would expand to my home directory, even on Win10. Is this a bug, or am I doing something wrong?



bedeke
2021-2-5 10:01:25

I think "~" only works in powershell


laurent.orseau
2021-2-5 10:01:35

Though not on Windows it seems


laurent.orseau
2021-2-5 10:03:02

Maybe time for expand-user-path to support it for windows too?


laurent.orseau
2021-2-5 10:07:05

Is there a way to make (write #true) output #true instead of #t?


gknauth
2021-2-5 10:08:27

On Win10 I get: > (expand-user-path "~") #<path:~> > (path->string (expand-user-path "~")) "~"


kellysmith12.21
2021-2-5 10:09:26

print-boolean-long-form I think


gknauth
2021-2-5 10:09:42

But it seems ~ is just a character, in the end, on Windows.



laurent.orseau
2021-2-5 10:10:12

perfect, thanks!


laurent.orseau
2021-2-5 10:10:19

(I did look for this, but missed it)


bedeke
2021-2-5 10:13:42

(system "powershell dir ~\\Documents") (system "dir ~\\Documents") … the first works … Don’t know if this can help you


gknauth
2021-2-5 10:48:59

@bedeke Thanks. I was listing the directory (or trying to) just because I was trying to figure out what Racket thought ~ was on Windows. The cause of this is on macos & GNU/Linux I have a ~/.<app>-prefs.rkt file I require, it has passwords and API keys and things I don’t check into GitHub, and I was puzzled Racket wasn’t finding that file on Windows. As a temporary workaround I put the prefs file in the local directory and changed everything that required it by removing "~/", but I’d love to have something more portable. I’m giving a talk at noon EST, and instead of working on the talk I was debugging ~ on Win10.


bedeke
2021-2-5 11:40:16

for something more portable, instead of ~, maybe use (current-directory-for-user) ?


gknauth
2021-2-5 11:42:02

(current-directory-for-user) yields the current directory, not my home directory, which is where I wanted to put the .<app>-prefs.rkt file.


bedeke
2021-2-5 11:43:34

ah, sorry, I was testing in an unsaved file


gknauth
2021-2-5 11:43:41

np


bedeke
2021-2-5 11:46:11

last try: (find-system-path 'home-dir)?


gknauth
2021-2-5 12:08:11

@bedeke That does work, thanks!


laurent.orseau
2021-2-5 13:12:49

I was hoping to resolve cyclic dependencies between modules by using submodules, but: File A.rkt: #lang racket ... (module* my-submod #false (require "B.rkt") ...) File B.rkt: #lang racket (require "A.rkt") ... This still gives me cyclic dependencies even though B.rkt does not require A’s submod. Is that intentional, or am I missing something?


mflatt
2021-2-5 13:16:56

Although this could work in principle, it doesn’t currently, and making it work looks difficult. The expander would need to be able to partially expand one module and make that available while it pauses to expand another module, and tools like raco make would have to be able to deal with cycles at the level of files.


laurent.orseau
2021-2-5 13:20:23

Ok makes sense, thanks. It’s still easy to resolve it with a new file anyway.


laurent.orseau
2021-2-5 13:21:29

Although, would it make the compiler’s life easier if submodules like module* were first extracted to a different file?


laurent.orseau
2021-2-5 13:25:07

You’d have a .dep and .zo per submodule


mflatt
2021-2-5 13:29:07

I think that would simplify some things and make other things (such as dealing with #false as a module language and searching for modules) more complicated. I’m not sure how any of the possible approaches would work out, but I doubt that there’s a simple trick to make it all easy.


ben
2021-2-5 13:57:01

does Racket have a way to set file/directory permissions?



ben
2021-2-5 14:07:15

thanks! I was looking at that & didn’t realize it worked like syntax-property


laurent.orseau
2021-2-5 15:41:21

What do you mean?


sorawee
2021-2-5 15:58:45

It can be used to both get and set the value.


yilin.wei10
2021-2-5 21:07:13

Continuing on from the thread in #beginners, the DepFun is entirely separate from functions under type-rep.rkt . Is there any material on how/why typed racket represents this stuff internally?


samth
2021-2-5 21:30:30

I think the short answer is no


yilin.wei10
2021-2-5 22:03:56

Hmm; that’s a shame.


yilin.wei10
2021-2-5 22:04:58

I’ve been trying to grok the code, but it’s a little difficult. In particular I can’t understand how the Arrow represents optional arguments.


yilin.wei10
2021-2-5 22:05:26

There’s a Listof Type? for the domain (which I think?) is the mandatory part of it.


yilin.wei10
2021-2-5 22:06:21

Oh!


yilin.wei10
2021-2-5 22:06:39

Unless it basically expands out into multiple Arrow ? One for each optional arg?


yilin.wei10
2021-2-5 22:10:07

Ah yes!


yilin.wei10
2021-2-5 22:10:13

OK I found it. That’s interesting


ben
2021-2-5 22:23:09

Exactly. (The reason might be: because Racket expands optional functions to case-lamba.)



samth
2021-2-5 23:00:18

Yes, that’s why. It might not be the best representation though, since it wastes a lot of space


kellysmith12.21
2021-2-6 03:42:54

Does anyone know of work/research on effect systems in a dynamically-typed setting?