[racket-users] Opening unix domain socket with SOCK_SEQPACKET in Racket?

2020-01-28 Thread Milo Turner
Hello all, I'm wondering if it's possible to open a unix domain socket with SOCK_SEQPACKET in Racket? It looks like currently unix-socket-lib uses SOCK_STREAM, and doesn't allow you to configure that flag. Is there a reason for this, or would it be a good idea to add this feature to the

[racket-users] Possible expander bug in internal definition contexts

2019-03-06 Thread Milo Turner
I was discussing with a friend some of the edge cases in how internal definition contexts and expansion work, when I accidentally ran into behavior that doesn't seem right. (let () (foo) (define-syntax-rule (define-it m) (define-syntax (m stx) #'"hello!")) (define-it foo)) ;; ->

Re: [racket-users] How to disallow certain characters in identifiers?

2018-12-19 Thread Milo Turner
Another option, which probably has a lot of terrible consequences, is to transform "a.b" into "3-d syntax" (a struct embedded in syntax) that can now be interpreted differently by forms that are interested. For instance a custom "define" could grab the 3d-syntax in the name and use it to make a

[racket-users] Re: Reasons not to use match or define/match?

2018-12-19 Thread Milo Turner
This is similar to the argument of "why not use let* everywhere you use let?" and there is no convincing answer IMO. I too am a big fan of pattern matching, and I would appreciate a #lang where every binding form is a pattern (ala ML, Haskell, ...). But in Racket as it exists today, I don't

[racket-users] cons-specific optimizations?

2018-11-27 Thread Milo Turner
Hello all, There's something I have been very curious of lately, about low level aspects of Racket's compiler. First of all, I have always considered "cons" to be essentially the same as a struct: (struct cons [hd tl] #:transparent) (define car (procedure-rename cons-hd 'car)) (define cdr

[racket-users] Re: #%module-begin with module+

2018-09-12 Thread Milo Turner
The reason for it using racket/base's #%module-begin is the same reasoning for how racket/base's #%app is inserted in a #lang racket module (and more crucially, inserted by macros defined in that module, no matter where the macro is used) -- You received this message because you are

Re: [racket-users] Struct initialization?

2018-03-09 Thread Milo Turner
You can also set! the extra constructor #lang racket (struct foo [a b c] #:extra-constructor-name -foo #:transparent) (define ((foo* make-foo) a b) (make-foo a b (+ a b))) (set! -foo (foo* -foo)) (foo 1 2) ; -> (foo 1 2 3) (match (foo 1 2) [(foo _ _ c) c]) ; -> 3 However I usually

[racket-users] Re: #lang rust

2018-03-06 Thread Milo Turner
FWIW at one point I began trying to translate something similar to Rust in Redex, but I haven't made progress on it in a few months. https://github.com/iitalics/rust-redex On Tuesday, February 20, 2018 at 1:21:46 AM UTC-5, Neil Van Dyke wrote: > > If someone is looking for a challenging and

Re: [racket-users] any reason why slideshow is still its own executable?

2018-03-06 Thread Milo Turner
Definitely agree with John. It's frustrating when running 'raco setup' and seeing a bunch of executables trying to be overwritten. I have just applied "chown milo" to /usr/share/racket to fix this but I may even switch to an in-place Racket build instead. On Monday, March 5, 2018 at 8:27:53 PM

[racket-users] Recursive Pattern Expander

2017-10-16 Thread Milo Turner
Hi. I talked with Matthias Felleisen and Ryan Culpepper this afternoon about parsing recursive structures using syntax/parse. I thought I'd give it a shot, so here's what I have so far: https://gist.github.com/iitalics/fb83780fd4cd6731d6fc046fb2dbac92 It turned out to be far too inconvenient

[racket-users] Submodules & Hygiene

2017-10-09 Thread Milo Turner
Hi Racketeers. I'm writing some macro code that generates submodules. I'm not entirely sure how hygiene is maintained when creating submodules, and now I have little idea why my macros are doing the crazy things that they are. Could anyone give a concrete explanation on how modules work with

[racket-users] Producing syntax from a submodule

2017-02-01 Thread Milo Turner
Hello, I'm new to writing #lang s-expr languages in Racket and I'm having trouble understanding what's going wrong. I've re-provided the essential syntax transformers and then defined a macro, and this works fine: > lang.rkt #lang racket (provide #%module-begin #%app #%datum