soegaard2
2020-4-27 07:21:57

Reminder: The European Lisp Symposium 2020 is now live. https://www.twitch.tv/elsconf


spdegabrielle
2020-4-27 09:27:08

Whats your project?


tlcu
2020-4-27 13:23:40

Hello, is there something like a Planet Racket I can subscribe to via RSS / Atom / etc ?


soegaard2
2020-4-27 13:24:35

Not yet. I haven’t made a feed for http://racket-stories.com\|racket-stories.com yet.


soegaard2
2020-4-27 13:24:44

There is a feed for Planet Scheme though.


tlcu
2020-4-27 13:25:22

looks great! I would be happy to help and/or subscribe


soegaard2
2020-4-27 13:25:58

The source is available on Github if you feel an itch to improve something.


tlcu
2020-4-27 13:26:14

soegaard2
2020-4-27 13:26:26

Yes.


tlcu
2020-4-27 13:27:09

thanks will take a look


soegaard2
2020-4-27 13:27:13

Most new blogs aren’t on Planet Scheme. Maybe they don’t know that they can get on it my sending me an email.



soegaard2
2020-4-27 13:28:10

The tutorial that eventually turned into Racket Stories is here: https://github.com/soegaard/web-tutorial


soegaard2
2020-4-27 13:28:26

That’s easier to get up and running.


spdegabrielle
2020-4-27 16:11:50

Does anyone know where I could find the text or a recording keynote ‘Multilingual Component Programming in Racket’ by MT ?


samth
2020-4-27 16:18:09

The slides are here: https://felleisen.org/matthias/Presentations/11GPCE/gpce11.pdf, it’s very unlikely there’s anything else to find.


samth
2020-4-27 17:01:08

@greg how do I set up completions in racket-xp-mode?


samdphillips
2020-4-27 17:02:01

In general I’ve been thinking of using “shells” for many things so just having a quick REPL type thing for prototyping is nice.


samdphillips
2020-4-27 17:03:12

I got it working yesterday with <100 LOC (mostly just finding the right mixins in framework) connecting to a simple minecraft RCON running some commands.


samdphillips
2020-4-27 17:04:02

I used to us MH for reading my email and a Racket backed MH with a nice gui shell is something I’m pondering now.


spdegabrielle
2020-4-27 17:04:38

Thank you. I posted the acmdl pdf on r/reddit and only realised it was an abstract and an series of references today.


greg
2020-4-27 17:06:49

I’m not sure what you mean by “set up”?

The completion candidates are found automatically whenever racket-xp-annotate is run (either automatically after you pause editing, or if you manually invoke it.)

To actually do completion, does M-x completion-at-point (usually bound to C-M-i) work for you? If so, do you mean you’d like that to be bound to a different key, or use company-mode, or $OTHER?


greg
2020-4-27 17:07:30

I do manual completion, with it set to TAB using a setting I can explain.


greg
2020-4-27 17:07:44

Some people like auto completion, usually with company-mode these days.


samth
2020-4-27 17:08:09

Ok, I will look into company-mode — do I have to do something to set it up with racket-xp-mode?


spdegabrielle
2020-4-27 17:09:24

Whats MH?


greg
2020-4-27 17:09:36

Do you use use-package?


samth
2020-4-27 17:09:52

I just installed it with install-package


spdegabrielle
2020-4-27 17:09:53

and what is a minecraft RCON?


spdegabrielle
2020-4-27 17:10:28

I was jsut curious before. Now I have to know!


greg
2020-4-27 17:11:51

OK, well my use-package config is https://github.com/greghendershott/.emacs.d/blob/master/init.el#L240-L250. But I think mainly you just need something like global-company-mode to turn it on everywhere in emacs. Or, add a call to company-mode in your racket-mode-hook and racket-repl-mode-hook for just those.


greg
2020-4-27 17:12:13

But there’s no special glue to make company-mode work with Racket Mode’s completion. it should “just work” automatically.


spdegabrielle
2020-4-27 17:12:47

It sounds like you are attaching a repl to anythign oyu can find an api for>


spdegabrielle
2020-4-27 17:12:49

?


spdegabrielle
2020-4-27 17:13:14

Which is brilliant, BTW.


greg
2020-4-27 17:13:38

TL;DR it’s just the usual enabling a mode or not, stuff, for company-mode. No other magic to make it work with Racket Mode.


greg
2020-4-27 17:16:00

Do you already understand how/why? If not, can you give me a small example how to break?


samth
2020-4-27 17:16:36

It breaks it because racket-mode now (transitively) depends on TR, so starting racket-mode fails


samth
2020-4-27 17:17:00

I think it’s because drracket/check-syntax transitively depends on TR


samth
2020-4-27 17:17:12

maybe because the blueboxes code is typed


greg
2020-4-27 17:17:26

Oh. :disappointed:


samth
2020-4-27 17:17:42

to see it in action, go to the typed-racket/main.rkt and add an extra (


greg
2020-4-27 17:18:03

If you disable racket-xp-mode, it might still work enough for you to do editing until you fix TR?


greg
2020-4-27 17:18:36

Because I think Racket Mode’s back end lazy-require’s drracket/check-syntax and won’t demand it until racket-xp-mode does.


samdphillips
2020-4-27 17:18:41

Haha.


greg
2020-4-27 17:18:55

(And if that’s false, it’s probably accidentally so and I could make it true, again.)


samdphillips
2020-4-27 17:19:37

MH is/was a mail user agent that used a small set of shell commands to read your mail and manipulate mailboxes



spdegabrielle
2020-4-27 17:21:27

And minecraft?


samdphillips
2020-4-27 17:21:29

RCON is a very simple protocol for sending command and getting responses


samdphillips
2020-4-27 17:22:00

It’s on a lot of game servers. So I wrote the protocol bit and hooked it to a minecraft server my kids are using


samdphillips
2020-4-27 17:22:33

that one just reads a line and sends the command to the server


spdegabrielle
2020-4-27 17:22:39

is it for admin? So you can kick them off the server at bedtime?


samdphillips
2020-4-27 17:22:54

yeah or give the items etc.


spdegabrielle
2020-4-27 17:23:33

liek spawners etc


samdphillips
2020-4-27 17:23:34

Just hooking the protocol to a pl allows scripting out stuff etc.


spdegabrielle
2020-4-27 17:25:55

Nice.


spdegabrielle
2020-4-27 17:26:04

I’d love to see a demo


spdegabrielle
2020-4-27 17:26:17

adn look at your code?


samdphillips
2020-4-27 17:28:02

Yeah, I’m going to clean it up to essentials and put it up on github.


spdegabrielle
2020-4-27 17:28:34

Nice


c
2020-4-27 17:42:56

@c has joined the channel


deactivateduser60718
2020-4-27 20:24:15

Forgive the screenshot. The docs are not online yet. Before I keep working on the package showing this example, I wanted to know if someone else already put out a library that uses hashes in this way.


soegaard2
2020-4-27 20:25:40

So it is a struct-like interface to hash-tables?


deactivateduser60718
2020-4-27 20:25:43

Yes.


samth
2020-4-27 20:25:53

Clojure is used that way


soegaard2
2020-4-27 20:26:02

Is a splay tree used anywhere?


deactivateduser60718
2020-4-27 20:26:13

No, but a thesaurus was.


deactivateduser60718
2020-4-27 20:26:28

:wink:


samth
2020-4-27 20:26:45

also I think you can define records to really be various kinds of data in Common Lisp, but I don’t know if hashes are one of the kinds


soegaard2
2020-4-27 20:26:47

I’d better look it “splay” up - I have never heard it used besides the phrase “splay tree”.


deactivateduser60718
2020-4-27 20:27:16

Yeah, sorry. I was looking for a word that indicated struct fields were scattered over a source.


samth
2020-4-27 20:27:37

I would suggest using a syntax more like struct, ie (splayed-struct editorial (title summary))


deactivateduser60718
2020-4-27 20:28:05

Sounds good, thanks @samth. Does Racket have an equivalent to how CL approaches records?


samth
2020-4-27 20:28:15

no, but it would be nice to


soegaard2
2020-4-27 20:29:34

Btw: “hierarchical”


deactivateduser60718
2020-4-27 20:29:43

I always mess that one up.


deactivateduser60718
2020-4-27 20:30:02

Same with “received”


soegaard2
2020-4-27 20:31:16

So a “splayed structure” is neither a splay tree nor a structure :slightly_smiling_face:


deactivateduser60718
2020-4-27 20:31:29

Correct. Open to a new name.


soegaard2
2020-4-27 20:34:38

Does “non-hierarchical” mean that you can’t store other splayed structures in a splayed structure?


deactivateduser60718
2020-4-27 20:35:29

No, I was meaning that you could not specify a super-id. My use case was made more complicated by inheritance.


deactivateduser60718
2020-4-27 20:36:32

I’m working on a plugin system of sorts where a user can decorate a singular value with groups of data. This library came from that.


soegaard2
2020-4-27 20:37:15

So “non-hierarchical” is an implementation choice and not a conceptual limitation?


deactivateduser60718
2020-4-27 20:40:36

From how I read your question, that sounds correct. I felt what I was doing was niche enough that expanding it too much would make it an annoying reinvention of structs.


soegaard2
2020-4-27 20:40:52

That’s fair.


soegaard2
2020-4-27 20:42:06

And to answer your original question: I can’t remember seeing a similar library.


deactivateduser60718
2020-4-27 20:42:32

Thanks much. The CL record stuff sounded interesting. If this plays out well and time permits I might be able to offer something there.


deactivateduser60718
2020-4-27 20:44:08

Is hash-subset too broad, or a misuse of the term? As in, (hash-subset news (title summary))


deactivateduser60718
2020-4-27 20:46:34

Maybe even subhash


soegaard2
2020-4-27 20:47:02

hash-struct ?


deactivateduser60718
2020-4-27 20:48:48

That works too. I’ll chew on this a bit. As always, naming things takes longer than making them work. :smile:


soegaard2
2020-4-27 20:49:09

Yeah, naming is hard.


deactivateduser60718
2020-4-27 20:57:25

I think this phrasing is easier to justify. Thanks @soegaard2 and @samth @title{Define Private Keys in a Hash using a Struct-Like Interface} Given a hash table, this library gives you a @racket[struct]-like interface for uninterned symbol keys. @racketblock[ (require hash-partitions) (hash-partition editorial (title summary)) (provide (hash-partition-out editorial [title string?] [summary (or/c #f string?)]))