RE: [racket-users] Re: Futures + threads SIGSEGV

2020-05-04 Thread Dexter Lagan
Thank you sir, no doubt futures are being used in an unsafe manner. The code was used in language benchmarks and was 'optimized' to squeeze every ounce of performance. What I find strange is that it does work well, and saturates all cores (that was the intent) on Win10, but crashes randomly on

[racket-users] multiple-value version of in-value

2020-05-04 Thread Jos Koot
Recently I needed a multiple value version of in-value. Does something like that exist already? I could not find it, so I made one: (define-syntax (in-values stx) (syntax-case stx () ((_ expr) #'(make-do-sequence (λ () (values (λ (p) expr) (λ (p) #f) #t (λ (p)

[racket-users] Re: On the importance of testing for noobs - or 'there's no such thing as a stupid test'.

2020-05-04 Thread Simon Schlee
And use contracts. I can't claim that all my code uses contracts everywhere, but when I encounter unexpected/bewildering behavior I add contracts to break those chains of "piped functions". You can start with define/contract for ease of use. Later on you can put functions that belong together i

Re: [racket-users] Re: On the importance of testing for noobs - or 'there's no such thing as a stupid test'.

2020-05-04 Thread Dexter Lagan
Yes! Haven’t played with contracts yet, but they’re next in my list. Cheers, Dex > On May 4, 2020, at 1:19 PM, Simon Schlee wrote: > >  > And use contracts. > I can't claim that all my code uses contracts everywhere, but when I > encounter unexpected/bewildering behavior I add contracts t

Re: [racket-users] multiple-value version of in-value

2020-05-04 Thread Philip McGrath
My package `adjutor` has a few variants of this, like `in-value*`: https://docs.racket-lang.org/adjutor/Stable.html#(part._.Sequence_.Constructors) They can all be used as first-class procedures, but that does involve a little runtime overhead, so they use `define-sequence-syntax` to cooperate dir

RE: [racket-users] multiple-value version of in-value

2020-05-04 Thread Jos Koot
Very nice. I have installed the package. Thanks very much, Jos From: Philip McGrath Sent: 04 May 2020 17:21 To: Jos Koot Cc: us...@racket-lang.org Subject: Re: [racket-users] multiple-value version of in-value My package `adjutor` has a few variants of this, like `in-value*`: https://docs.racket

[racket-users] Fwd: [Racket]VS Code Racket extension gains LSP support via /r/Racket

2020-05-04 Thread Stephen De Gabrielle
-- Forwarded message - From: Date: Sun, 3 May 2020 at 23:36 Subject: [Racket]VS Code Racket extension gains LSP support via /r/Racket To: *VS Code Racket extension gains LSP support* Hey, remember Magic Racket (GitHub , VS Code marketpla

[racket-users] Re: [Racket]VS Code Racket extension gains LSP support via /r/Racket

2020-05-04 Thread Evžen Wybitul
You beat me to it! I’d like to thank all of the people that reported bugs, suggested features, and also to @jjpro and @jeapostrophe, as without them the LSP support wouldn’t be there just yet. Cheers! Dne pondělí 4. května 2020 20:43:21 UTC+2 Stephen De Gabrielle napsal(a): > > > > -- F

RE: [racket-users] multiple-value version of in-value

2020-05-04 Thread Jos Koot
To Philip McGrath, Hi again I modified the clause ((id ...) (in-value* expr ...)) to the following in-values clause: ((id ...) (in-values expr)) where the expr is supposed to return as many values as ids. I simplified the code such as to avoid syntax-parse, because I do not (yet) understand all

[racket-users] Matching groups of optional elements

2020-05-04 Thread David Storrs
I'm trying to write a parser for a CSV file with optional columns. Simplified version: There are 2 mandatory columns, after which there can be 0+ 4-column groups describing a person. Each group has the same column headers. ; legal column arrangements: RequiredA RequiredB RequiredA RequiredB Name

Re: [racket-users] multiple-value version of in-value

2020-05-04 Thread Philip McGrath
Glad it was useful! There is a variant `in-value*/expression` that works like your `in-values`: https://docs.racket-lang.org/adjutor/Stable.html#(form._((lib._adjutor%2Fmain..rkt)._in-value*%2Fexpression)) -Philip On Mon, May 4, 2020 at 10:12 PM Jos Koot wrote: > To Philip McGrath, Hi again >

Re: [racket-users] Matching groups of optional elements

2020-05-04 Thread Michael MacLeod
I'm not sure this is possible with only using `match` patterns. A combination of the `list-rest` and `app` patterns as well as the `in-slice` procedure from `racket/sequence` should do the trick, though: #lang racket (require racket/match) (define (collect-optional-vals x) (for/list ([y (in-sl

Re: [racket-users] Matching groups of optional elements

2020-05-04 Thread Philip McGrath
Depending on your requirements, I would consider using `syntax-parse` at runtime: this is easily written with its `~seq` patterns, and you get nicer error reporting. Here's an example—I use syntax classes for clarity, but they aren't necessary, if you prefer to be more concise: #lang racket (req

Re: [racket-users] Matching groups of optional elements

2020-05-04 Thread David Storrs
Fantastic. Thanks, Michael. On Mon, May 4, 2020 at 10:39 PM Michael MacLeod wrote: > I'm not sure this is possible with only using `match` patterns. A > combination of the `list-rest` and `app` patterns as well as the `in-slice` > procedure from `racket/sequence` should do the trick, though: >

Re: [racket-users] Matching groups of optional elements

2020-05-04 Thread David Storrs
Thanks, Phillip. On Mon, May 4, 2020 at 10:44 PM Philip McGrath wrote: > Depending on your requirements, I would consider using `syntax-parse` at > runtime: this is easily written with its `~seq` patterns, and you get nicer > error reporting. > > Here's an example—I use syntax classes for clarit