[racket-users] matching M-N instances

2020-09-13 Thread David Storrs
Using the 'match' form, is there a straightforward way to have optional items in a pattern? For example: (match records [(list (? string? name) 0..1 phone-numbers ..1) 'ok]) This would match a list of phone numbers that might or might not have the owner's name (either as a single string or as

Re: [racket-users] Why is struct/contract so much faster than a guard?

2020-09-03 Thread David Storrs
For the record, a self-plug: #lang racket (require struct-plus-plus) (struct foo-guard (bar baz) #:guard (struct-guard/c any/c list?)) (struct/contract foo-contract ([bar any/c] [baz list?])) (struct++ foo-spp ([bar any/c] [baz list?]))

Re: [racket-users] new racket-lang.org website

2020-08-26 Thread David Storrs
Wow! That's beautiful. Also, I'm on it which is a nice bit of egoboo. Thank you for all your hard work. On Tue, Aug 25, 2020 at 1:51 PM Robby Findler wrote: > Hi all: as you may know if you follow dev@, we've been revising the > website. The new version went live last night; please have a

Re: [racket-users] slideshow -> google slides?

2020-08-07 Thread David Storrs
On Thu, Aug 6, 2020, 10:34 PM Hendrik Boom wrote: > On Thu, Aug 06, 2020 at 06:58:28PM -0400, 'John Clements' via Racket Users > wrote: > > Has anyone here developed a reasonable workflow for exporting slideshow > presentations to google slides? It appears that google slides cannot import > PDFs

Re: [racket-users] Removing duplicates from a list while still maintaining order in Dr. Racket.

2020-07-20 Thread David Storrs
"double post", not "dinner post". Damn. Email needs an edit function and no autocorrect. On Mon, Jul 20, 2020, 1:09 PM David Storrs wrote: > First off, if this was an intentional dinner post, well played. :> > > > If you don't want to use built-in func

Re: [racket-users] Removing duplicates from a list while still maintaining order in Dr. Racket.

2020-07-20 Thread David Storrs
First off, if this was an intentional dinner post, well played. :> If you don't want to use built-in functions, I would look at using a hash to track what you've already seen and then cons things together depending on if they're in the hash. For the second, maybe recur through the list using a

Re: [racket-users] Best data structure for ordered data set with insertion and reordering?

2020-07-17 Thread David Storrs
Thanks George. Much appreciated. On Thu, Jul 16, 2020 at 11:21 PM George Neuner wrote: > > Hi David, > > On 7/16/2020 11:44 AM, David Storrs wrote: > > On Thu, Jul 16, 2020 at 10:09 AM George Neuner > wrote: > >> >> The problem seems under-specifi

Re: [racket-users] Best data structure for ordered data set with insertion and reordering?

2020-07-16 Thread David Storrs
On Thu, Jul 16, 2020 at 10:09 AM George Neuner wrote: > > On 7/16/2020 4:29 AM, David Storrs wrote: > > The problem seems under-specified. Can you say more about the real > purpose? > Basic version: It's a peer-to-peer encrypted swarmed file sharing system that pre

Re: [racket-users] Re: Best data structure for ordered data set with insertion and reordering?

2020-07-16 Thread David Storrs
On Thu, Jul 16, 2020, 5:23 AM evdubs wrote: > Do you think you'll need to try to identify the order that the events were > created in? > > What if user A does: > > $ touch file.txt > $ rm file.txt > > And what if user A had separately done: > > $ rm file.txt > Error: file not found > $ touch

[racket-users] Best data structure for ordered data set with insertion and reordering?

2020-07-16 Thread David Storrs
tl;dr Can anyone recommend a data structure that is ordered and supports efficient reordering, insertion at arbitrary location, and deletion? Long form: I'm working on an operation-log reconciliation problem, where each operation is one of: File-CreateP H File-Update P H File-Delete

Re: [racket-users] Wills, plumbers, and checking if a port is closed

2020-07-02 Thread David Storrs
> > Ryan > > On Wed, Jul 1, 2020 at 1:08 AM Matthew Flatt wrote: > >> At Tue, 30 Jun 2020 16:27:56 -0400, David Storrs wrote: >> > I have a port that (my current theory says) is being closed when it >> > shouldn't, but I'm having trouble isolating exactly where

[racket-users] Wills, plumbers, and checking if a port is closed

2020-06-30 Thread David Storrs
I have a port that (my current theory says) is being closed when it shouldn't, but I'm having trouble isolating exactly where and when. I thought maybe I could do something Rackety to say "as soon as this port gets closed, run this function". I went digging through Wills and Plumbers but I'm

Re: [racket-users] How to handle conflicts in packages?

2020-06-05 Thread David Storrs
Got it. I'll change that, and thank you. On Fri, Jun 5, 2020 at 11:28 AM Sam Tobin-Hochstadt wrote: > This most likely means that your documentation is in a file with a generic > name like manual.scrbl which those packages also use. > > Sam > > On Fri, Jun 5, 2020, 11:20 AM D

[racket-users] How to handle conflicts in packages?

2020-06-05 Thread David Storrs
I uploaded a new module, 'thread-with-id', and the package server tells me that there are conflicts. The message is: https://pkg-build.racket-lang.org/conflicts.txt doc "main": ekans lti-freq-domain-toolbox protobuf thread-with-id I'm not sure what this means -- I've looked through the

Re: [racket-users] Re: rackunit and logging

2020-05-24 Thread David Storrs
On Sat, May 23, 2020 at 9:54 AM Shriram Krishnamurthi wrote: > Thank you all! > > *Dave*, the documentation style is fine, it's sometimes easier to read > the doc right next to the implementation. (-: > > However, I'm not quite sure how even your example works. Maybe someone can > check my

Re: [racket-users] rackunit and logging

2020-05-23 Thread David Storrs
Hi Shriram, I have a module, handy/test-more (https://pkgs.racket-lang.org/package/handy), that I think does everything you want; the downside is that the documentation is thorough but it's in the form of essay-style comment sections instead of Scribble. Breaking that out into actual Scribble is

[racket-users] Structs that masquerade as channels

2020-05-22 Thread David Storrs
Is there a way to make a struct that can seamlessly pretend to be a channel the same way one can pretend to be an output-port? I'm pretty sure the answer is no but wanted to confirm. Example: (struct person (name to) #:property prop:output-port (struct-field-index to)) (displayln "yay" (person

Re: [racket-users] Re: Is there an easy way to daemonize a thread?

2020-05-19 Thread David Storrs
Perfect, thank you. On Tue, May 19, 2020 at 5:28 PM George Neuner wrote: > On Tue, 19 May 2020 12:01:54 -0400, David Storrs > wrote: > > >I'm using the file-watchers module to keep an eye on a directory tree and > >trigger various actions whenever something changes.

[racket-users] Is there an easy way to daemonize a thread?

2020-05-19 Thread David Storrs
I'm using the file-watchers module to keep an eye on a directory tree and trigger various actions whenever something changes. I had an issue where an exception was thrown, the thread died, and file watching therefore stopped. The immediate solution is to wrap a with-handlers around it so it

Re: [racket-users] Button click callback syntax

2020-05-12 Thread David Storrs
Hi Philip, The essence here is when evaluation happens: ; All of these are equivalent: (define foo (lambda () 7) (define foo (thunk 7)) ; 'thunk' is a term of art meaning "function of 0 arguments" (define (foo) 7) Try running the following code in the repl: ; start code (define

[racket-users] Question about positive vs negative blame

2020-05-11 Thread David Storrs
If I understand correctly, "positive blame" refers to servers and "negative blame" refers to clients. I think this means: (define/contract (add-10 x) (-> number? number?) "oops") (add-10 7); Call-A (add-10 "oops") ; Call-B `add-10` accepts a number and promises to return a number,

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

2020-05-04 Thread David Storrs
t;> 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

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

2020-05-04 Thread David Storrs
als optional-vals)) >(list req-a req-b optional-vals)]) > > On Mon, May 4, 2020 at 7:16 PM David Storrs > wrote: > >> 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 >>

[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

Re: [racket-users] Reducing parentheses without language damage.

2020-05-01 Thread David Storrs
On Fri, May 1, 2020, 11:25 PM Raoul Duke wrote: > $0.02, whitespace sensitivity is just bad ux in the long run. haskell can > get away with it more than python because haskell can be written more > concisely i feel than python. but even in H it is sorta unfortunate. > > i like how iirc clojure

Re: [racket-users] a minor regexp question (and a how-could-I-answer-it-myself? question)

2020-05-01 Thread David Storrs
For the record, it's probably better to stick with #px in all cases. The vast majority of non-Racket code is based off the pcre library, which stands for "Perl-compatible regular expressions" so if you stick with #px the regex will be more familiar to more people. Plus, standardizing on one

Re: [racket-users] Reducing parentheses without language damage.

2020-04-30 Thread David Storrs
On Thu, Apr 30, 2020 at 11:16 AM Hendrik Boom wrote: > On Thu, Apr 30, 2020 at 09:36:15AM +0200, Dexter Lagan wrote: > > There’s one thing I noticed: if debugging is disabled, then > parenthesis highlighting is also disabled (as well as other visual aids, if > I remember well?). The editor

Re: [racket-users] Should I stop sending packages to the catalog?

2020-04-29 Thread David Storrs
On Wed, Apr 29, 2020 at 12:47 PM Sage Gerard wrote: > April 9th in the #general Slack channel taught me that there was no clean > way to > release a breaking change in a package. I'm open to working on version > pinning > support in raco pkg provided that a maintainer can walk me through some >

Re: [racket-users] Rhombus project plan

2020-04-29 Thread David Storrs
/urldefense.com/v3/__https://github.com/racket/racket/pull/874__;!!NCZxaNi9jForCP_SxBKJCA!E1HW0DYeDaBURU0NVZ0qTBoXcScUGqgl1F962-iW9Qn3LDAl5HBdsyRd6LAwe2w$ > which I think is > mostly a matter of JavaScript programming now. > > Sam > > On Wed, Apr 29, 2020 at 9:35 AM David Storrs > wr

Re: [racket-users] Rhombus project plan

2020-04-29 Thread David Storrs
racket/pull/874 which I think is > mostly a matter of JavaScript programming now. > > Sam > > On Wed, Apr 29, 2020 at 9:35 AM David Storrs > wrote: > > > > > > > > On Wed, Apr 29, 2020 at 8:21 AM Matthew Flatt > wrote: > >> > >> At Wed, 29

Re: [racket-users] Rhombus project plan

2020-04-29 Thread David Storrs
On Wed, Apr 29, 2020 at 8:21 AM Matthew Flatt wrote: > At Wed, 29 Apr 2020 11:14:47 +0200, Dexter Lagan wrote: > > To the point: what would make Racket2 the ultimate tool (for me): > > Performance. Faster startup times, shorter execution times in general. > > Optionally, a ‘lite’ version of

Re: [racket-users] Functions not being linked in scribble

2020-04-28 Thread David Storrs
.rkt")) *) Did a raco pkg install to ensure that test was a recognized collection. *) scribble test.scrbl At that point it works correctly. Thank you! > Sam > > On Tue, Apr 28, 2020 at 11:32 AM David Storrs > wrote: > > > > Here's my test code. I get th

Re: [racket-users] Functions not being linked in scribble

2020-04-28 Thread David Storrs
(dep ((lib "racket/contract/base.rkt") any)) (dep ((lib "racket/contract.rkt") any)) (dep ((lib "racket/contract/private/misc.rkt") any)) (dep (# foo)) (dep ((lib "racket/main.rkt") any)) On Tue, Apr 28, 2020 at 11:00 AM Ben Greenman wrote: > On 4/2

Re: [racket-users] Rhombus project plan

2020-04-28 Thread David Storrs
I'll throw this in simply so that it's part of this thread. There's nothing new here, so if you've seen my comments in earlier Racket2 threads then you can skip this. I've said before and continue to think that getting rid of the parenthesis syntax is a major error. It is inarguable that there

[racket-users] Functions not being linked in scribble

2020-04-28 Thread David Storrs
According to what I see in Scribble, both actual examples and in the documentation, I had thought that if I did @defproc[func-name] then func-name would become a link target and later uses of @racket[func-name] would automatically link to that site. I'm clearly missing something; my functions are

Re: [racket-users] visit a sequence of files

2020-04-21 Thread David Storrs
all the files is the > painful part. Also, the display of tabs is not totally great when you have > sixty or seventy of them open. Sorry, it might not have been clear that I > want a list of sixty or seventy files. > > John > > > On Apr 21, 2020, at 1:34 PM, David Storrs &

Re: [racket-users] [racket users] struct #:methods question

2020-04-21 Thread David Storrs
On Mon, Apr 20, 2020 at 6:50 PM Jon Zeppieri wrote: > There's no trick to it: > > #lang racket/base > > (require racket/generic) > > (define-generics foo > (foo-do foo x)) > > (struct thing (x) > #:methods gen:foo > [(define (foo-do f x) > (thing x))]) > > > On Mon, Apr 20, 2020 at

Re: [racket-users] visit a sequence of files

2020-04-21 Thread David Storrs
I don't use DrRacket much, but would the normal 'previous / next window' commands work for you? On Mac it's: previous window: Shft + Cmd + ~ next window: Cmd + ~ or previous window: Cmd + next window: Cmd + On Tue, Apr 21, 2020 at 4:29 PM 'John Clements' via Racket Users <

Re: [racket-users] New to racket, help with coursework question

2020-04-20 Thread David Storrs
Great job! For the record: Yes, it is entirely possible to have an 'if' clause choose the arguments to a function. This is legal: (define first-element (vector-ref some-vector (if (equal? type 'zero-indexed) 0 1))) As is this, which is more relevant to your exercise: (define leap-year-months

Re: [racket-users] DrRacket and command line arguments

2020-04-18 Thread David Storrs
t; > See the docs > <https://docs.racket-lang.org/reference/runtime.html?q=current%2Dcommand%2Dline%2Darguments#%28def._%28%28quote._~23~25kernel%29._current-command-line-arguments%29%29> > for more information. > > > On Sat, Apr 18, 2020 at 11:03 AM David Storrs > wrote:

[racket-users] DrRacket and command line arguments

2020-04-18 Thread David Storrs
Is there a way to specify command line arguments when running inside DrRacket? For example: #lang racket (define foo (make-parameter 7)) (command-line #:program "foo" #:once-each [("--thing") thing "The thing" (foo thing)] ) (displayln (foo)) If running in DrRacket, how can I make this

Re: [racket-users] Gradual Typed Racket?

2020-04-17 Thread David Storrs
On Fri, Apr 17, 2020 at 9:45 AM Ben Greenman wrote: > Hi Marc, > > > >> For contracts, though, (provide (contract-out ...)) gives better error > >> messages than define/contract. > >> > > > > In what sense is this the case, and where can I read more about the > > differences, as well as how to

[racket-users] ports->ssl-ports issues, plus DTLS question

2020-04-10 Thread David Storrs
We are trying to use TLS (or, more specifically, DTLS) over UDP. In order to do this we create an input-port?/output-port? pair via make-pipe and then run the pair through ports->ssl-ports. The handshake this causes is failing and therefore the whole process hangs and the ports don't get

Re: [racket-users] Are there interfaces for IP ports at least raw sockets?

2020-04-02 Thread David Storrs
On Thu, Apr 2, 2020 at 1:32 PM George Neuner wrote: > > > On 4/2/2020 1:00 PM, David Storrs wrote: > > On Thu, Apr 2, 2020 at 12:37 PM George Neuner wrote: > > > > > > Windows historically placed a lot of limitations on the use of raw > > > socke

Re: [racket-users] Are there interfaces for IP ports at least raw sockets?

2020-04-02 Thread David Storrs
reciated. > > Sam > > On Thu, Apr 2, 2020 at 1:00 PM David Storrs wrote: > > > > On Thu, Apr 2, 2020 at 12:37 PM George Neuner wrote: > > > > > > > > > On 4/2/2020 11:13 AM, David Storrs wrote: > > > > The Reference lists TC

Re: [racket-users] Are there interfaces for IP ports at least raw sockets?

2020-04-02 Thread David Storrs
On Thu, Apr 2, 2020 at 12:37 PM George Neuner wrote: > > > On 4/2/2020 11:13 AM, David Storrs wrote: > > The Reference lists TCP and UDP but nothing else. I'd like to be able > > to implement ICMP, since there doesn't seem to be such a thing at the > > moment, and I

[racket-users] Are there interfaces for IP ports at least raw sockets?

2020-04-02 Thread David Storrs
The Reference lists TCP and UDP but nothing else. I'd like to be able to implement ICMP, since there doesn't seem to be such a thing at the moment, and I'm trying to figure out how to do that. In an ideal world I'd have something like ip-in and ip-out ports as the complement to tcp-in and

Re: [racket-users] racket/draw: how to extract the path from a font% object?

2020-04-01 Thread David Storrs
I knocked together a very minimal pure-Racket library for this so you don't have to FFI. It won't give you all the bells and whistles, but it should be a good starting point. https://pkgd.racket-lang.org/pkgn/package/font-finder Docs:

[racket-users] Is there an ICMP library?

2020-04-01 Thread David Storrs
Is there a way to generate ICMP messages from Racket, the way there is a UDP and TCP library? My Google-fu is apparently insufficient and the Reference doesn't include anything. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe

[racket-users] UDP networking issue

2020-03-27 Thread David Storrs
This isn't a Racket question per se, but I'm hoping someone here will have a suggestion. We're working on NAT traversal, it's failing to connect, and we aren't clear why. On hostname Alice on the LAN: (define s (udp-open-socket)) (udp-bind! s #f 3) (udp-send-to s "18.218.67.59" 54545 #"hi")

Re: [racket-users] Arbitrary property types on structs?

2020-03-25 Thread David Storrs
Got it. I'm actually relieved that this isn't possible, since it means I wasn't simply being dumb. On Wed, Mar 25, 2020, 7:41 PM Sam Phillips wrote: > On 2020-03-25 14:16, David Storrs wrote: > > This would let me use a struct as an output port: > > > > (struct foo

[racket-users] Arbitrary property types on structs?

2020-03-25 Thread David Storrs
This would let me use a struct as an output port: (struct foo (name out) #:property prop:output-port (struct-field-index out)) I'd like to be able to set up a struct such that I can use it as a UDP socket, something like the following pseudo-code: (struct foo (socket) #:property prop:udp

Re: [racket-users] Best way to say "terminate unless received by X time"

2020-03-24 Thread David Storrs
Aha! I didn't know there was a udp-receive-evt. That's exactly what I needed, thank you. On Tue, Mar 24, 2020, 4:15 PM Jon Zeppieri wrote: > On Tue, Mar 24, 2020 at 4:03 PM David Storrs > wrote: > > > > I've got this code: > > > > (thread > > (thunk &g

[racket-users] Best way to say "terminate unless received by X time"

2020-03-24 Thread David Storrs
I've got this code: (thread (thunk (let loop () (define-values (len shost sport) (udp-receive! socket buffer)) ...do stuff with the received message... (loop I'd like to be able to say "If you haven't received a message in X time, kill the thread". I'm not sure how to

Re: [racket-users] Contracts on parameters

2020-03-23 Thread David Storrs
meter%2Fc%29%29 > for more information. > > Best, > Michael > > On Mon, Mar 23, 2020, 12:36 PM David Storrs wrote: >> >> (define/contract (foo x) >> (-> boolean? any) >> 'ok) >> >> (foo #t) >> 'ok >> (foo 7) >> ;

[racket-users] Contracts on parameters

2020-03-23 Thread David Storrs
(define/contract (foo x) (-> boolean? any) 'ok) (foo #t) 'ok (foo 7) ; foo: contract violation ; expected: boolean? ; given: 7 ; in: the 1st argument of ; (-> boolean? any) ; contract from: (function foo) ; blaming: top-level ;(assuming the contract is correct) ; at:

Re: [racket-users] Terminal Phase hits 1.0

2020-01-19 Thread David Storrs
Oh, cool. It's Defender in ASCII art. Neat idea, and I'm interested to see how to do cursor positioning in Racket. Thanks for the link. On Sun, Jan 19, 2020 at 10:57 PM Christopher Lemmer Webber < cweb...@dustycloud.org> wrote: > Hello, > > Just a small blogpost about Terminal Phase, which

[racket-users] Logging to STDOUT and to file

2020-01-15 Thread David Storrs
At runtime I can use PLTSTDERR to specify which log messages are displayed to STDOUT. Is there a way to specify at runtime *where* they should be logged? That is, is there a built-in that does this: PLTSTDERR="debug@the-logger error" racket foo.rkt | tee foo.log ...except without using tee?

Re: [racket-users] Re: Racket2 and syntax

2020-01-13 Thread David Storrs
On Mon, Jan 13, 2020 at 10:38 AM John Cowan wrote: > > > On Sunday, July 14, 2019 at 10:30:04 PM UTC-4, Matthew Flatt wrote: > > At RacketCon today, after summarizing the state of work on Racket CS, I >> recommended that we next explore the possibly of changing to an >> infix-oriented syntax in

Re: [racket-users] racket-mode finds wrong version of Racket

2019-12-16 Thread David Storrs
ou. > > -- bruno cuconato > > On Mon, 16 Dec 2019 at 14:28, David Storrs wrote: > > > > I just now updated to 7.5 from 7.3, then updated my .bashrc to have the > correct path. I'm using GNU Emacs in Terminal on OSX 10.11. > > > > > > $ echo $PATH &

[racket-users] racket-mode finds wrong version of Racket

2019-12-16 Thread David Storrs
I just now updated to 7.5 from 7.3, then updated my .bashrc to have the correct path. I'm using GNU Emacs in Terminal on OSX 10.11. $ echo $PATH [...stuff that isn't Racket...]:/Applications/Racket_v7.5.0.10/bin:[...stuff that isn't Racket...] >From a .rkt file: C-c C-c Welcome to Racket v7.3.

Re: [racket-users] Racket 7.5 DMG file does not open on OSX 10.11

2019-12-11 Thread David Storrs
ince they're > created with an older version of Mac OS. > > At Wed, 11 Dec 2019 10:45:08 -0500, David Storrs wrote: > > Thanks, Matthew, > > > > The version on the downloads page seems to still be APFS. Will it > rebuild > > at some point? > > > > On Tue, De

Re: [racket-users] Racket 7.5 DMG file does not open on OSX 10.11

2019-12-11 Thread David Storrs
Thanks, Matthew, The version on the downloads page seems to still be APFS. Will it rebuild at some point? On Tue, Dec 10, 2019 at 8:46 PM Matthew Flatt wrote: > I’ve changed the distribution build to use HFS+ going forward. > > > On Dec 10, 2019, at 6:28 PM, James Platt wrote: > > > > > >>

Re: [racket-users] Sharing a udp socket between threads via parameters

2019-12-05 Thread David Storrs
Cool, thanks! On Thu, Dec 5, 2019, 4:11 PM Matthew Flatt wrote: > At Thu, 5 Dec 2019 14:26:17 -0500, David Storrs wrote: > > My understanding is that parameters are copied between threads, but I'm > not > > sure how this interacts with things like file ports, network co

Re: [racket-users] Re: GUI (get-directory)

2019-12-05 Thread David Storrs
For the record, my big concern with the documentation is that it's extremely hard to contribute to. I would be delighted to contribute documentation if the process was easy, but it's just not. For a language as amazing as Racket and a documentation set as high-quality as Racket's, the difficulty

[racket-users] Sharing a udp socket between threads via parameters

2019-12-05 Thread David Storrs
My understanding is that parameters are copied between threads, but I'm not sure how this interacts with things like file ports, network connections, etc. Would the following code be problematic? (define conn (make-parameter)) (define s (udp-open-socket)) (udp-bind! s #f 12345) (conn s)

Re: [racket-users] contract for an "overloaded function"

2019-11-29 Thread David Storrs
I think you want `case->`: https://docs.racket-lang.org/reference/function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._case-~3e%29%29 On Fri, Nov 29, 2019 at 2:28 PM Ryan Kramer wrote: > I'm not exactly sure what I mean by "overloaded function", but I think you > will

[racket-users] Racket 7.5 DMG file does not open on OSX 10.11

2019-11-25 Thread David Storrs
When I download and install the .dmg file from racket-lang, I'm told "no mountable filesystems". I'm not sure if this is an issue with how it was built, with my machine, or with OSX in general. This may not be worth worrying about, since OSX 10.11 was released September 30, 2015 and Apple has

Re: [racket-users] polymorphic datastructures in typed/racket

2019-11-18 Thread David Storrs
On Mon, Nov 18, 2019 at 12:23 PM David Storrs wrote: > > > On Mon, Nov 18, 2019 at 10:09 AM Sam Tobin-Hochstadt > wrote: > >> >> Third, your version with structs can't work because you can't tell >> what type a function expects -- that infor

Re: [racket-users] polymorphic datastructures in typed/racket

2019-11-18 Thread David Storrs
On Mon, Nov 18, 2019 at 10:09 AM Sam Tobin-Hochstadt wrote: > > Third, your version with structs can't work because you can't tell > what type a function expects -- that information is not there at > runtime. > If there is a contract assigned to a function, is it possible to get that function

Re: [racket-users] Anyone who has mastered DrRacket

2019-11-11 Thread David Storrs
Hi Mahmmadullah, It sounds like you're asking for help with homework. I suspect there will be general reluctance to help you with that in more than general terms, and also reluctance to provide a personal contact address. Why don't you try asking the list directly, without including actual scans?

Re: [racket-users] Evaluating to get the output with a specific lang

2019-11-11 Thread David Storrs
Don't forget to handle multiple value return. What will you do if the last line in the file is (values a b)? Also, side effects. Do you care if someone includes a print/write/display statement? You mentioned that the code would be safe, so presumably tcp-connect and sqlite3-connect are not

Re: [racket-users] Version number issue with snapshot 7.5.0.6

2019-11-04 Thread David Storrs
On Mon, Nov 4, 2019 at 11:47 AM Matthew Flatt wrote: > > At Mon, 4 Nov 2019 11:30:49 -0500, David Storrs wrote: > > read-compiled-linklet: version mismatch expected: "7.5.0.5" found: > > "7.5.0.6" in: > > /Applications/snapshot_Racket_v7.5.0.6/coll

Re: [racket-users] Version number issue with snapshot 7.5.0.6

2019-11-04 Thread David Storrs
> > John Clements > > > On Nov 4, 2019, at 08:30, David Storrs wrote: > > > > read-compiled-linklet: version mismatch expected: "7.5.0.5" found: > > "7.5.0.6" in: > > /Applications/snapshot_Racket_v7.5.0.6/collects/racket/compiled/main_r

[racket-users] Version number issue with snapshot 7.5.0.6

2019-11-04 Thread David Storrs
read-compiled-linklet: version mismatch expected: "7.5.0.5" found: "7.5.0.6" in: /Applications/snapshot_Racket_v7.5.0.6/collects/racket/compiled/main_rkt.zo I'm on OSX 10.11.6 if that matters. -- You received this message because you are subscribed to the Google Groups "Racket Users"

Re: [racket-users] Efficient idiom for converting key-set of a hash-map into a hash-set

2019-10-25 Thread David Storrs
On Fri, Oct 25, 2019 at 10:28 AM Thomas Dickerson wrote: > > For reasons that are unclear to me, hash-keys and dict-keys both return a > list? instead of a set? (frankly, this seems like a bug in the API...). > > Is there a something I can do that's more efficient than just calling > list->set?

Re: [racket-users] Remind me?: bidirectional channel-ish thing in two parts

2019-10-25 Thread David Storrs
Yep! That was it. Thanks. On Fri, Oct 25, 2019 at 2:43 AM Eric Griffis wrote: > > Maybe pipe ports? > > https://docs.racket-lang.org/reference/pipeports.html > > Eric > > > On Thu, Oct 24, 2019, 11:28 PM David Storrs wrote: >> >> I saw something in th

[racket-users] Remind me?: bidirectional channel-ish thing in two parts

2019-10-25 Thread David Storrs
I saw something in the Reference about bi-directional {pipes | channels | ???} with a constructor that returned two values, A and B, where data put onto A could be read out of B and vice versa. I can't remember what it was called and my reference-search-fu is weak. It's not the one from

[racket-users] Setting TTL on non-multicast UDP

2019-10-16 Thread David Storrs
I'm implementing the port prediction NAT-traversal algorithm[1], part of which specifies sending non-multicast UDP packets with very short TTLs. The only method I see in the Racket docs for setting TTL on UDP is the udp-multicast-set-ttl! function. Is there a way to do this for regular UDP

Re: [racket-users] Syntax pattern to match a sequence with x identical elements?

2019-10-11 Thread David Storrs
Alexis, is there any way that we can get this explanation and some of the ones you've given me added to the Guide? I've tried to add things to the documentation before, or even just submit typo reports but, as I've mentioned before, the way the docs are organized (random little snippets scattered

Re: [racket-users] Re: Structured Concurrency in Racket

2019-10-09 Thread David Storrs
Note that it's possible to send S-expressions through a channel and then eval them on the far end. This would let you do something like this: (hash 'func 'my-predefined-lambda 'args '(arg1 arg2)) Which calls a predefined function, or: (hash 'install '(lambda (username) (displayln (~a "Hello, "

Re: [racket-users] Current state of racket2 planning?

2019-10-04 Thread David Storrs
> > Sam > > On Fri, Oct 4, 2019, 8:42 AM David Storrs wrote: > >> The racket2 discussion dropped off my radar a while ago but I got some >> spoons back and thought I'd check in again. Where should I look to see the >> ongoing discussion / current state? >> >

[racket-users] Current state of racket2 planning?

2019-10-04 Thread David Storrs
The racket2 discussion dropped off my radar a while ago but I got some spoons back and thought I'd check in again. Where should I look to see the ongoing discussion / current state? Sidebar: I read the Honu paper... Is the current plan still "programmer writes C-ish code and then, behind the

Re: [racket-users] Ensuring that channels are GC'd when the child thread terminates

2019-10-02 Thread David Storrs
Ok, thanks. On Wed, Oct 2, 2019, 4:16 PM Matthew Flatt wrote: > At Wed, 2 Oct 2019 11:06:14 -0400, David Storrs wrote: > > On Wed, Oct 2, 2019 at 8:42 AM Matthew Flatt wrote: > > > It depends on `process-file`. If `process-file` retains `msg` until it > > >

Re: [racket-users] Ensuring that channels are GC'd when the child thread terminates

2019-10-02 Thread David Storrs
On Wed, Oct 2, 2019 at 8:42 AM Matthew Flatt wrote: > > At Tue, 1 Oct 2019 23:52:05 -0400, David Storrs wrote: > > ; main dispatcher loop in the server. Receives messages, dispatches > > to child thread for processing > > > 2) This WOULD work: > > (let loop

[racket-users] Ensuring that channels are GC'd when the child thread terminates

2019-10-01 Thread David Storrs
I have a server with a main dispatcher loop that receives messages and farms them out to processing threads. I'd like to have able to have later messages inform the behavior of earlier message processing -- an example would be "message 1: here is a file to download" followed by "stop downloading

Re: [racket-users] gen:equal+hash on hashes or other non-struct data structure

2019-10-01 Thread David Storrs
t 10:38 PM Philip McGrath wrote: > > On Tue, Oct 1, 2019 at 10:21 PM David Storrs wrote: >> >> For example, there's a hash, hasheqv, and hasheq. Is there a way to >> have a hash with a user-provided key-comparison function? > > > You probably want `define-c

[racket-users] gen:equal+hash on hashes or other non-struct data structure

2019-10-01 Thread David Storrs
Is it possible to put gen:equal+hash on something other than a struct? For example, there's a hash, hasheqv, and hasheq. Is there a way to have a hash with a user-provided key-comparison function? -- You received this message because you are subscribed to the Google Groups "Racket Users"

Re: [racket-users] Re: Confusion with udp-receive!

2019-09-26 Thread David Storrs
On Wed, Sep 25, 2019 at 8:16 PM David Storrs wrote: > > On Wed, Sep 25, 2019 at 7:45 PM Alex Harsanyi wrote: > > > > Is there any tunneling involved for connecting to your AWS instance? > > > > There is only one copy of the source port in an IP+UDP datagram, and

Re: [racket-users] Confusion with udp-receive!

2019-09-25 Thread David Storrs
Hi Greg, On Wed, Sep 25, 2019 at 3:33 PM George Neuner wrote: > > Hi David, > > On 9/25/2019 1:08 AM, David Storrs wrote: > What you are overlooking is that UDP is a level 4 [end-to-end] protocol, > but you are trying to get level 3 [routing] information. > > Neit

Re: [racket-users] Re: Confusion with udp-receive!

2019-09-25 Thread David Storrs
On Wed, Sep 25, 2019 at 2:57 PM Matthew Flatt wrote: > > At Wed, 25 Sep 2019 12:49:36 -0400, David Storrs wrote: > > 1) Is it possible that there is a bug in the underlying C code? > > It's always possible. But if I understand the original problem, it > seems unlike

Re: [racket-users] Re: Confusion with udp-receive!

2019-09-25 Thread David Storrs
at 9:28 AM David Storrs wrote: > > > > On Wed, Sep 25, 2019, 3:16 AM Alex Harsanyi wrote: >> >> Do you know what port the router is using for NAT? Are you sure that the >> router is not simply choosing the same port, so 25890 is both your local >> port and

Re: [racket-users] Re: Confusion with udp-receive!

2019-09-25 Thread David Storrs
t to be sure. Regards, it really shouldn't be doing that. If so, it's leaking information about the inner network to the outside, and that's not what I'd expect from the latest version of the FOSS OpenWRT. > Alex. > > On Wednesday, September 25, 2019 at 1:08:16 PM UTC+8, David Storrs wro

[racket-users] Confusion with udp-receive!

2019-09-24 Thread David Storrs
udp-receive! is giving me unexpected results when my local machine -> router -> server shows the UDP port of the process running on the local machine instead of the one from the router. I'm not sure how to get the router's port instead. The AWS server does this: (define-values (len

Re: [racket-users] Would it help to call racket2 something else?

2019-08-28 Thread David Storrs
On Wed, Aug 28, 2019, 11:43 PM Sage Gerard wrote: > > Maybe I'm overthinking this. I already know that nothing in #lang racket > is getting thrown out or anything. Yes, it is. #lang racket uses parenthesized S-expressions and prefix notation such that operator precedence is not relevant and

Re: [racket-users] Would it help to call racket2 something else?

2019-08-28 Thread David Storrs
On Wed, Aug 28, 2019 at 5:08 PM Daniel Prager wrote: > Changing the canonical syntax seems like a bigger jump than from PLT > Scheme to Racket. > > Perhaps a name change would help. > > I looked up English language anagrams of racket and found two: retack and > tacker. > > *retack** [Nautical]

Re: [racket-users] Is there an expanded form of the Racket2 purpose declaration?

2019-08-28 Thread David Storrs
a way to go > beyond the limitations of S-expressions and do something more powerful > and interesting. I think people will like us more after in as much as > I think people like awesome things, and I want to make something > awesome. > > Jay > > -- > Jay McCarthy >

[racket-users] Is there an expanded form of the Racket2 purpose declaration?

2019-08-27 Thread David Storrs
The discussion on Racket2 seems to have moved offlist to the RFC list on github (https://github.com/racket/racket2-rfcs/issues); are there other locations? There is one question that I had back at the beginning of the process that I didn't manage to get clarity on, which is the rationale behind

Re: [racket-users] [racket ursers] Keyword question

2019-08-23 Thread David Storrs
There's also keyword-apply: https://docs.racket-lang.org/reference/procedures.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._keyword-apply%29%29 (define (f x #:y y #:z

[racket-users] Re: Do custodians shutdown when Racket exits?

2019-08-06 Thread David Storrs
I should mention that the reason I'm looking into this is because I have UDP sockets that are not getting closed. They are managed by custodians, but the custodians are not releasing them; I take this to mean that the custodians are not being run. On Tue, Aug 6, 2019 at 1:06 PM David Storrs

<    1   2   3   4   5   6   7   8   >