Re: [racket-users] how do I remove a specified collection?

2022-08-10 Thread David Storrs
The problem is more likely to do with the shell misunderstanding '?', but you can find a collection using: https://docs.racket-lang.org/raco-fc/index.html On Mon, Aug 8, 2022 at 11:31 AM Don Green wrote: > $ raco setup ? > collection-path: collection not found > collection: "t" > > How do I

Re: [racket-users] Combining contract checking with normalization?

2022-03-07 Thread David Storrs
Would this give part of what you're looking for? #lang racket (define (my-string-length s) ((or/c (and/c (or/c symbol? string?) (compose1 string-length ~a)) (curry raise-arguments-error 'my-string-length "invalid arg" "arg")) s)) (my-string-length "foo") (my-string-length 'foo)

Re: [racket-users] looking for advice on a web background process manager

2022-01-06 Thread David Storrs
Speaking of existing task managers: https://docs.racket-lang.org/majordomo2/index.html On Wed, Jan 5, 2022 at 7:31 PM Stefan Schwarzer wrote: > On 2021-12-30 21:33, 'Wayne Harris' via Racket Users wrote: > > I'm considering writing a manager for background processes --- such as > send a

[racket-users] Happy holidays to all

2021-12-25 Thread David Storrs
Happy holidays, everyone. The Racket community has been very welcoming and helpful to me over the years, and everyone here is a lovely person. I hope you're all having a lovely holiday. Dave -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To

Re: [racket-users] Beginner's question

2021-12-14 Thread David Storrs
Jens answered your question, but I'll note two convenient shorthands: > #lang racket > (require racket/format) racket/format is provided by #lang racket, so you can skip that. This: (define fp (lambda (s n) (string-append (pp_number n) " + " s))) is the same as this: (define (fp s n)

Re: the end of the [racket-users] mailing list and the migration to Discourse as a forum for Racket

2021-11-22 Thread David Storrs
That's sudden. On Mon, Nov 22, 2021 at 8:06 AM Etan Wexler wrote: > The stewards of Racket have decided that it’s > time to give up on the mailing list (that is, racket-users > , to which this message is > a contribution).

Re: [racket-users] racket-mode / paredit combine closing parens

2021-11-17 Thread David Storrs
Ah, that looks right. Thanks, Siddhartha. On Wed, Nov 17, 2021 at 1:59 PM Siddhartha Kasivajhula wrote: > Was curious about this feature so I went looking. It might be lispy-tab > <http://oremacs.com/lispy/#lispy-tab>. > > > On Wed, Nov 17, 2021 at 10:35 AM David Storrs &

[racket-users] racket-mode / paredit combine closing parens

2021-11-17 Thread David Storrs
In Emacs, I've seen a demonstration where one keystroke can pull all closing parens together, transforming this (point/cursor position is shown as |): (let () (let () (some-func 'a)| ) ) into this: (let () (let () (some-func 'a)))| I haven't been able to find the relevant

Re: [racket-users] Best way to append an element to a list?

2021-11-16 Thread David Storrs
unction) > (printf "~a: " (object-name function)) > (time > (void (for/fold ([l null]) > ([n (in-range target-length)]) > (function l n))))) > > (profile A) > (profile B)) > > On 11/16/21 2:04 PM, David Storrs w

[racket-users] Best way to append an element to a list?

2021-11-16 Thread David Storrs
If I want to add an element to the end of an immutable list, is it better to do: (append current-list (list new-element)) or (reverse (cons new-element (reverse current-list))) or something else? I would imagine it's the first one because that should be a single traversal and link add instead

Re: [racket-users] How to learn the *core* of Racket?

2021-11-11 Thread David Storrs
Out of curiosity, what is it that you're trying to achieve here? You're not going to program in the fully-expanded language, you're going to program in something higher level. Is this purely a "learning assembly code is good because it gives you a better understanding of machine architecture"

Re: [racket-users] How to learn the *core* of Racket?

2021-11-11 Thread David Storrs
Sure, that's as good a definition as any. On Thu, Nov 11, 2021, 6:04 AM Yushuo Xiao wrote: > Thank you for your comprehensive answer! It helps a lot. I also read more > about Racket after I posted the question and now I think that the few > special forms (as stated in "fully expanded program")

Re: [racket-users] How to learn the *core* of Racket?

2021-11-06 Thread David Storrs
Hi Yushuo, On Sat, Nov 6, 2021 at 5:33 AM Yushuo Xiao wrote: > I've learned some Racket, and can comfortably program in it, but I only > learned it as an ordinary language, much like Scheme. I know Racket is much > more than that, for its "language-oriented" features. Languages become a >

Re: [racket-users] How to discover a struct's interface without Dr Racket?

2021-10-31 Thread David Storrs
][+]" name > "struct")) > struct-plus-plus)) > > (struct horse (breed color legs)) > > (define beauty (horse 'arabian 'black 4)) > > (define info (force (struct-ref beauty))) > (map struct-field-name (struct-info-fields info)) > > The result is: &g

Re: [racket-users] How to discover a struct's interface without Dr Racket?

2021-10-31 Thread David Storrs
On Sun, Oct 31, 2021, 7:49 AM Jens Axel Søgaard wrote: > Hi Brian, > > A few random thoughts: > > > I would like, given only the symbol foo referring to the struct type > itself, > > to discover (at least) the list of procedures foo?, foo-a, foo-b, plus > > anything else the author of foo (the

Re: [racket-users] Adding keybindings to debug

2021-10-30 Thread David Storrs
The menu strings get very fussy, so check that you entered it exactly right, and do a very simple one to start. That's the usual cause in my experience. On Sat, Oct 30, 2021, 7:25 AM Mike Engelhart wrote: > On Mac OS I tried adding keyboard shortcuts using the linked Apple support > document to

Re: [racket-users] Adding keybindings to debug

2021-10-28 Thread David Storrs
I don't know if this fills the need but it's a useful thing to know regardless: macOS will allow you to add a keyboard shortcut for any menu item in any application. https://support.apple.com/guide/mac-help/create-keyboard-shortcuts-for-apps-mchlp2271/mac On Thu, Oct 28, 2021 at 1:10 PM James

Re: [racket-users] [ANN] Splitflap: generating valid Atom and RSS feeds

2021-10-26 Thread David Storrs
On Mon, Oct 25, 2021 at 10:25 PM 'Joel Dueck' via Racket Users < racket-users@googlegroups.com> wrote: > > >- Removing dependencies: yes, I see the appeal. I’m really not eager >to reimplement all the timezone handling and temporal comparison stuff in >gregor, though. > > Joel >

Re: [racket-users] How to require untrusted module?

2021-10-22 Thread David Storrs
I'd be interested to know this as well. It sounds like something that isn't possible in Racket, since it's essentially specifying how a module can do its job and that requires a level of introspection that I think is excluded by design. On Thu, Oct 21, 2021 at 10:37 AM kalime...@gmail.com

Re: [racket-users] hash->list with try-order? (like hash-map)

2021-10-22 Thread David Storrs
On Thu, Oct 21, 2021 at 5:26 AM George Neuner wrote: > > On 10/20/2021 5:53 PM, unlimitedscolobb wrote: > > > You can get a lot of mileage out of the 'set' datatype, which removes ordering from the equation, especially since lists will act as sets in a pinch. (When you want to improve

Re: [racket-users] rename-out not working as expected

2021-10-12 Thread David Storrs
ry to change the dynamic displayed name: > https://docs.racket-lang.org/static-rename/index.html > > -- > William J. Bowman > > On Tue, Oct 12, 2021 at 03:07:13PM -0400, David Storrs wrote: > > --- > > ; test.rkt > > #lang racket > >

[racket-users] rename-out not working as expected

2021-10-12 Thread David Storrs
--- ; test.rkt #lang racket (define (do-something) "ok") (provide do-something) ; test2.rkt #lang racket (require "test.rkt") (provide (rename-out [do-something do-it])) #lang racket (require "test2.rkt") do-it --- The printed value is # although I was expecting #. Have

Re: [racket-users] Re: Escape continuations for fussy code

2021-10-01 Thread David Storrs
On Fri, Oct 1, 2021 at 11:58 AM Hendrik Boom wrote: > On Fri, Oct 01, 2021 at 02:22:14PM +, Jesse Alama wrote: > > Hello, > > > > Have you ever wished you could do a C-style return in the middle > > of a block of Racket code? When you're in the heat of things with > > a complicated problem

Re: [racket-users] Having trouble getting documentation to generate

2021-09-29 Thread David Storrs
Cool, thanks. On Wed, Sep 29, 2021 at 11:23 AM Matthew Flatt wrote: > At Wed, 29 Sep 2021 11:20:47 -0400, David Storrs wrote: > > On Wed, Sep 29, 2021 at 9:57 AM Matthew Flatt > wrote: > > > > > At Wed, 29 Sep 2021 02:27:53 +, Philip McGrath wrote: > >

Re: [racket-users] Having trouble getting documentation to generate

2021-09-29 Thread David Storrs
On Wed, Sep 29, 2021 at 9:57 AM Matthew Flatt wrote: > At Wed, 29 Sep 2021 02:27:53 +, Philip McGrath wrote: > > I haven't tried `raco setup` to look at its output, but one possible > > improvement would be for whatever code complains about the "invalid > `deps' > > specification" to always

Re: [racket-users] Having trouble getting documentation to generate

2021-09-28 Thread David Storrs
On Tue, Sep 28, 2021 at 3:30 PM Ben Greenman wrote: > On 9/28/21, David Storrs wrote: > > > Also, any ideas on why the remove fails? > > > > $ raco pkg remove try-catch > > raco pkg remove: invalid `deps' specification > > specification:

[racket-users] [ANN] try-catch - exception handling with dynamic-wind guarantees

2021-09-28 Thread David Storrs
Module name: try-catch https://pkgd.racket-lang.org/pkgn/package/try-catch Lisp stereotypically has a problem that it's super easy to write your own code so the library ecosystem ends up fractured, with multiple options to do the same thing. McCarthy forbid that I should break the stereotype,

Re: [racket-users] [ANN] fmt: a Racket code formatter

2021-09-28 Thread David Storrs
This is very cool, Sorawee. Thank you for sharing. On Tue, Sep 28, 2021 at 2:03 PM Sorawee Porncharoenwase < sorawee.pw...@gmail.com> wrote: > Announcing the pre-alpha version of fmt, a Racket code formatter. Code > formatter is a tool that reformats your code so that it conforms to a style >

Re: [racket-users] Having trouble getting documentation to generate

2021-09-28 Thread David Storrs
:36 PM Ben Greenman wrote: > On 9/28/21, David Storrs wrote: > > Summary: Documentation for a new module is not being generated when I > > would expect it to be and when I do it manually it ends up not linking > > basic Racket items. I've done a lot of searching to figure it ou

[racket-users] Having trouble getting documentation to generate

2021-09-28 Thread David Storrs
Summary: Documentation for a new module is not being generated when I would expect it to be and when I do it manually it ends up not linking basic Racket items. I've done a lot of searching to figure it out and would appreciate some help. Long version: I published a module a few days ago

Re: [racket-users] Strange readline/racket-mode behavior

2021-09-24 Thread David Storrs
The dev team will have to answer your actual question, but I thought I might offer a more compact solution that incorporates the fix you mentioned: (define (yn #:read-one-char? [read-one-char? #f]) (display "y/n: ") (flush-output (current-output-port)) (define func (if read-one-char?

Re: [racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread David Storrs
On Fri, Sep 24, 2021 at 2:37 PM John Clements wrote: > I think I wouldn’t say “accepts”; I usually reserve this term for > functions, but that’s a minor quibble. > > I think I would call these “clauses”, as in > > “With-handlers allows the user to specify exception-handling clauses. Each > one

Re: [racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread David Storrs
sts of a predicate and an action." > > Jay > > -- > Jay McCarthy > Associate Professor @ CS @ UMass Lowell > http://jeapostrophe.github.io > Vincit qui se vincit. > > > On Fri, Sep 24, 2021 at 1:25 PM David Storrs > wrote: > >> Racket has a number o

Re: [racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread David Storrs
. > Okay, but what about in (with-handlers ((symbol? (lambda (e) (displayln e ...)? That's an association between two things but not a binding pair. Also, sorry, I should have been clearer up front by giving more than the one example. > On Fri, Sep 24, 2021 at 10:25 AM David Storrs > wrote:

[racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread David Storrs
Racket has a number of forms that include what look like lists of lists but are not. For example: (let ((foo 7) (bar 8)) ...) What would the '(foo 7)' and '(bar 8)' elements be called? Groups, maybe? -- You received this message because you are subscribed to the Google Groups "Racket Users"

Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-17 Thread David Storrs
and dotted accessors for clarifying field names. It doesn't support inheritance but it would make it easy to do many of the things I think you might be interested in. https://docs.racket-lang.org/struct-plus-plus/index.html On Fri, Sep 17, 2021 at 3:08 PM David Storrs wrote: > > NB: Y

Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-17 Thread David Storrs
NB: You did a 'reply' to Sorawee instead of to the list as a whole, and also the same for the email I sent. Probably good to 'reply all' so that the list gets the full context. Sorawee offered some good advice on how to do the things you're asking about and asked relevant questions. I'm

Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-16 Thread David Storrs
Sorawee answered your immediate question, but I figured I'd offer a pointer to Fear of Macros in case you haven't seen it: https://www.greghendershott.com/fear-of-macros/ It helped me a lot when I was trying to get my head around macros. Also, I got a lot of value from reading through the code

[racket-users] Set logging (or env variables generally) in racket-mode

2021-09-14 Thread David Storrs
racket-mode is terrifically useful, and my only issue with it is that it doesn't show logging messages. Is there a way to make it do that? -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving

Re: [racket-users] Re: Is there a way to format keys/values like raise-arguments-error

2021-09-10 Thread David Storrs
On Fri, Sep 10, 2021 at 1:33 PM kamist...@gmail.com wrote: > I like the apply max instead of foldl, quite a bit easier. > > Instead of `(format "\t~a" (~a (~a k #:width width) v #:separator "\t"))` > I prefer one of these: > (~a "\t" (~a k #:width width) "\t" v) > (~a #:separator "\t" "" (~a k

Re: [racket-users] Is there a way to format keys/values like raise-arguments-error

2021-09-10 Thread David Storrs
at 5:26 PM Laurent wrote: > Maybe take a look at the text-table package. > > On Wed, 8 Sep 2021, 14:41 David Storrs, wrote: > >> raise-arguments-errors produces neatly stacked key/value pairs with >> whitespace arranged such that values line up even when keys are

Re: [racket-users] Re: Is there a way to format keys/values like raise-arguments-error

2021-09-10 Thread David Storrs
Wow, thank you Simon. That was above and beyond. I should have thought of ~a to start with. With your pointers I came up with a less flexible solution that is sufficient to the current issue: #lang racket/base (require racket/format racket/string) (define my-keys '("bacon" "eggs"

[racket-users] [module announce] in-out-logged

2021-09-08 Thread David Storrs
Package: https://pkgs.racket-lang.org/package/in-out-logged Wraps a chunk of code in "entering" and "leaving" log messages, returns the value(s) produced by the code. Example: Keyword arguments are all optional. #:to and #:at may appear in either order but #:with must come last if it is

Re: [racket-users] Why does syntax-parser work here but not syntax-parse?

2021-09-08 Thread David Storrs
*headdesk headdesk headdesk headdesk headdesk* Thank you. On Wed, Sep 8, 2021 at 2:02 PM Stephen Chang wrote: > > shouldn't the entire parenthesized expression be given to the macro > processor and then replaced with something valid before being rejected? > > That would be true if you're

[racket-users] Why does syntax-parser work here but not syntax-parse?

2021-09-08 Thread David Storrs
This is from the documentation and it obviously works: (define parser1 (syntax-parser [((~alt (~once (~seq #:a x) #:name "#:a keyword") (~optional (~seq #:b y) #:name "#:b keyword") (~seq #:c z)) ...) 'ok])) (parser1 #'(#:a 1)) When run it yields 'ok. If I

[racket-users] Is there a way to format keys/values like raise-arguments-error

2021-09-08 Thread David Storrs
raise-arguments-errors produces neatly stacked key/value pairs with whitespace arranged such that values line up even when keys are of different lengths. Is there an easy way to get that for something that is not an error? I've been through both The Printer and the raise-arguments-error sections

Re: [racket-users] New module log-bracketed; should probably be something else

2021-09-03 Thread David Storrs
to use a format string if you want something different. > On Thu, Sep 2, 2021 at 2:06 PM Martin DeMello > wrote: > >> I do like the second form better, especially since the actual code being >> run is not obscured by simply being the last argument to a long log >> function. &g

[racket-users] New module log-bracketed; should probably be something else

2021-09-02 Thread David Storrs
I often find that for debugging I want to see a log message saying "I'm about to do X" followed by X followed by "I'm done with X" and I want it to return the result of X. I wrote this macro and posted it to the package server: https://pkgs.racket-lang.org/package/log-bracketed In retrospect,

[racket-users] Changing log destination from the environment

2021-08-25 Thread David Storrs
I've always used loggers in their default form, where they send to the terminal, and then I use tee if I want it to go to a file as well. That's easy and effective but there's got to be a better way. Two questions: 1) Is there a way to change logger destinations from the environment such that

Re: [racket-users] [ANN] Introducing "social" contracts

2021-08-16 Thread David Storrs
Hi Siddhartha, Will this package handle ->* and ->i, either now or in the future? On Sat, Aug 14, 2021 at 1:40 PM Siddhartha Kasivajhula wrote: > Fellow Scheming Racketeers, > When you've written a function that takes an integer and returns another > one, you may write a contract for it as (->

[racket-users] Is anyone looking to hire a junior web developer?

2021-07-10 Thread David Storrs
I have an acquaintance who has been learning web development as a way out of the poverty trap she's stuck in. I don't have personal experience with her skills but I can say that she's highly motivated and will work hard. If anyone has a Python or web-development job opening, could you drop me a

Re: [racket-users] Moving a function into a different `place?`

2021-07-01 Thread David Storrs
fine but then your interface doesn't match what the user is expecting. https://groups.google.com/g/racket-users/c/wexYxYYU7GE/m/3zXxn6NoAwAJ?pli=1 > Sam > > On Thu, Jul 1, 2021 at 2:36 PM David Storrs > wrote: > > > > What is the best way to pass a function into a child `pla

[racket-users] Moving a function into a different `place?`

2021-07-01 Thread David Storrs
What is the best way to pass a function into a child `place`? I've got a server function that accepts a dispatch function as one of its arguments and I need to be able to run the server in a separate `place` (in the dynamic-place sense) because it's part of a GUI application. [details] My

Re: [racket-users] invalid memory error from parameter with contracted guard

2021-06-24 Thread David Storrs
but applying a > parameter's guard procedure didn't use `|#%app|` as it should have. The > repair was to add `|#%app|`. > > At Thu, 24 Jun 2021 09:55:39 -0400, David Storrs wrote: > > Great! You're the best, Matt. What was the issue, if it's simple enough > to > > explain

Re: [racket-users] invalid memory error from parameter with contracted guard

2021-06-24 Thread David Storrs
repair was commit > > cb959879de21406571fb0127ded88c54e171c0eb > > See also https://github.com/racket/racket/issues/3865 > > > Matthew > > > At Wed, 23 Jun 2021 22:30:53 -0400, David Storrs wrote: > > I'm seeing an "invalid memory reference. Some debugging context lost&

[racket-users] invalid memory error from parameter with contracted guard

2021-06-23 Thread David Storrs
I'm seeing an "invalid memory reference. Some debugging context lost" error when using a parameter that has a guard function AND the guard function is user-defined AND the guard function has a contract on it. What is the right place to file this aside from the list? Demonstration: #lang

Re: [racket-users] Why would writing to a pipe fail?

2021-06-16 Thread David Storrs
ntent length: ~a, written ~a, expected ~a" (pipe-content-length rx-out) num-bytes-written (bytes-length bstr (displayln "done") output avail: 16777216 space available? #t pipe content length: 0 done test.r On Wed, Jun 16, 2021 at 4:13 PM David Storrs wrote: > Got it. T

Re: [racket-users] Why would writing to a pipe fail?

2021-06-16 Thread David Storrs
Got it. Thanks. On Wed, Jun 16, 2021 at 3:45 PM Matthew Flatt wrote: > At Wed, 16 Jun 2021 14:25:40 -0400, George Neuner wrote: > > It looks like the problem > > is that "flush" is not defined ... > > Yes, "returns without blocking after writing as many bytes as it can > immediately flush" is

Re: [racket-users] Why would writing to a pipe fail?

2021-06-16 Thread David Storrs
For the record, it doesn't work in 8.1 either. On Wed, Jun 16, 2021 at 2:44 PM David Storrs wrote: > > > On Wed, Jun 16, 2021 at 2:25 PM George Neuner > wrote: > >> >> On 6/16/2021 2:16 PM, David Storrs wrote: >> >> Damn. Sorry, I posted

Re: [racket-users] Why would writing to a pipe fail?

2021-06-16 Thread David Storrs
On Wed, Jun 16, 2021 at 2:25 PM George Neuner wrote: > > On 6/16/2021 2:16 PM, David Storrs wrote: > > Damn. Sorry, I posted out of sync versions of code and output. This is > correct: > > (define bstr (make-shared-bytes 509 5)) > (define rx-pipe-size 16777216) > (

Re: [racket-users] Why would writing to a pipe fail?

2021-06-16 Thread David Storrs
output: avail: 16777216 space available? #t pipe content length: 0 rx buffer overflow. pipe content length: 15, written 15, expected 509 done On Wed, Jun 16, 2021 at 2:11 PM George Neuner wrote: > > On 6/16/2021 1:19 PM, David Storrs wrote: > > I'm getting bytes off the wire a

[racket-users] Why would writing to a pipe fail?

2021-06-16 Thread David Storrs
I'm getting bytes off the wire and attempting to write them to a port. I have a check in place to verify that the pipe has free space but when I attempt to reports that yes, there is space, and then it writes and fails regardless and I'm not sure why. The following is a simplified version of the

Re: [racket-users] Computed properties for a struct?

2021-06-07 Thread David Storrs
On Fri, Jun 4, 2021 at 6:21 PM flirora wrote: > Is there a way to define a struct so that it has a field whose value is > filled in (instead of passed to the constructor) with a value derived from > other fields? For example, could you define a struct foo with two > explicit fields, x and y,

Re: [racket-users] Freenode -> libera.chat

2021-05-20 Thread David Storrs
What happened with Freenode? On Thu, May 20, 2021 at 8:12 AM Tony Garnock-Jones < to...@leastfixedpoint.com> wrote: > On 5/20/21 1:28 PM, Paulo Matos wrote: > > Tony Garnock-Jones writes: > >> With the recent damage to the Freenode IRC network, a new `#racket` has > >> been founded on

Re: [racket-users] Sharing scope in setup/cleanup for dynamic-wind?

2021-05-19 Thread David Storrs
On Tue, May 18, 2021 at 4:09 PM Philip McGrath wrote: > On Tue, May 18, 2021 at 3:52 PM Sam Tobin-Hochstadt > wrote: > >> I think the key question is what you want to happen if you would need >> to re-run the "pre" thunk, because you re-enter the code via a >> continuation. >> >> In many cases,

Re: [racket-users] Sharing scope in setup/cleanup for dynamic-wind?

2021-05-18 Thread David Storrs
quot;)) > (lambda () (finalize-connection conn > > Sam > > On Tue, May 18, 2021 at 2:08 PM David Storrs > wrote: > > > > dynamic-wind is nice because it guarantees that the pre- and > postconditions for a chunk of code will be run regardless of continuation &

[racket-users] Sharing scope in setup/cleanup for dynamic-wind?

2021-05-18 Thread David Storrs
dynamic-wind is nice because it guarantees that the pre- and postconditions for a chunk of code will be run regardless of continuation jumps, exceptions, etc. The only issue I have is that the three thunks do not share scope, making it difficult to do setup/teardown workflows. I feel like I

Re: [racket-users] Help in understanding 'letrec' example

2021-05-13 Thread David Storrs
Incidentally, a more concise way of doing this would be: (define target (build-path "tarzan")) ; convert to path only once (for/or ([item (in-directory "/tmp/test")]) ; or whatever directory you want to start in (equal? target (file-name-from-path item))) On Sat, May 8, 2021 at 3:50 AM Utkarsh

Re: [racket-users] Is there a good Racket DSL alternative to Image Magick?

2021-05-13 Thread David Storrs
On Wed, May 12, 2021 at 9:21 PM Ben Greenman wrote: > On 5/12/21, Robert Haisfield wrote: > > Daniel, that's awesome. How would I filter down this list according to > the > > regex? > > > > (define list-of-files (map path->string (directory-list starting-path))) > > You can wrap it in a filter:

Re: [racket-users] Injecting local contracts for prefab constructors

2021-05-12 Thread David Storrs
If you're willing to accept a low tech solution, might I suggest this: $ perl -i.bak -lpe 's/\(foo/\(make-foo/g' *.rkt Also, I'll self-plug and point you towards this: #lang racket (require struct-plus-plus ) (struct++ foo ([a real?]) (#:omit-reflection) #:prefab) (define checked (foo++ #:a

Re: [racket-users] Running user-supplied code in a place

2021-04-07 Thread David Storrs
Thanks, George. This helped a lot. On Wed, Apr 7, 2021 at 9:03 PM George Neuner wrote: > > > On 4/7/2021 5:34 PM, David Storrs wrote: > > I'm trying to expand a task manager to optionally use places and I'm > > having some trouble understanding the issue. > > >

Re: [racket-users] Werid contract violation blame erros

2021-04-07 Thread David Storrs
I've always liked define/contract because it guarantees the safety of the function from erroneous calls by other functions in the module, which helps with debugging and testing. It sounds like you think that's a bad move? On Wed, Apr 7, 2021 at 4:35 PM Robby Findler wrote: > > The short answer:

[racket-users] Running user-supplied code in a place

2021-04-07 Thread David Storrs
I'm trying to expand a task manager to optionally use places and I'm having some trouble understanding the issue. ; test.rkt #lang racket (provide start) (define (start thnk) (sync (place ch (place-channel-put ch (thnk) ; x.rkt #lang racket (require "test.rkt") (start (thunk 'ok))

Re: [racket-users] How to make a sandboxed evaluator in Scribble

2021-04-01 Thread David Storrs
On Thu, Apr 1, 2021 at 3:58 PM Sam Tobin-Hochstadt wrote: > > You might use `(list 'value-evt)` if that's the require you want. > > Sam ... Blarg. Yes, thank you. Should have realized. > > On Thu, Apr 1, 2021 at 3:41 PM David Storrs wrote: > > > > I c

[racket-users] How to make a sandboxed evaluator in Scribble

2021-04-01 Thread David Storrs
I cargo-culted this chunk of code and, predictably, it is now failing for reasons I don't understand. This is in the value-evt scribble file; it works fine when I build the file manually but it's failing in the package server build: @(define eval (call-with-trusted-sandbox-configuration

Re: [racket-users] New package announce: value-evt

2021-04-01 Thread David Storrs
if that hid defaults that would otherwise be > provided. > > https://github.com/dstorrs/value-evt/blob/master/info.rkt > https://github.com/dstorrs/thread-with-id/blob/master/info.rkt > > If that's not it, I'd have to take time after work to look more closely. > > On

Re: [racket-users] New package announce: value-evt

2021-04-01 Thread David Storrs
ing documentation" but the .html file did not appear in the directory and it's not linked into my local doc set. I hadn't noticed because I had previously created the file directly using 'scribble value-evt.scrbl' What might I have done wrong? > On 4/1/21 12:12 PM, David Storrs wrote: >

[racket-users] New package announce: value-evt

2021-04-01 Thread David Storrs
Wraps an arbitrary value into a synchronizable event. The synchronization result of the event is the original value, with two exceptions: procedures sync to their return value and lists sync recursively. Both of these values can be disabled via keywords. The package server is telling me that it

[racket-users] Package server certificate expired

2021-04-01 Thread David Storrs
Not sure where the right place is to report this, but the certificate for pkgd.racket-lang.org expired on 3/31/2021. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an

Re: [racket-users] Re: Racket on Corporate Desktop Windows

2021-03-30 Thread David Storrs
Slightly offtopic, but I wanted to point out that when GMail sees a conversation happening it collapses all the emails into one line and displays the first names of the first two posters side-by-side with the subject. I am tickled to have a thread from Bruce O'Neel and Wayne Harris in my email.

Re: [racket-users] Best way to say 'block until true'?

2021-03-19 Thread David Storrs
rofessor @ CS @ UMass Lowell > http://jeapostrophe.github.io > Vincit qui se vincit. > > On Fri, Mar 19, 2021 at 1:02 PM David Storrs > wrote: > > > > > > > > On Fri, Mar 19, 2021 at 12:02 PM Jay McCarthy > wrote: > >> > >> The best

Re: [racket-users] Best way to say 'block until true'?

2021-03-19 Thread David Storrs
ds, then outputs "success" (check-x) ; outputs "success" immediately (check-x) ; ibid > > -- > Jay McCarthy > Associate Professor @ CS @ UMass Lowell > http://jeapostrophe.github.io > Vincit qui se vincit. > > On Fri, Mar 19, 2021 at 11:59 AM David Storrs

Re: [racket-users] Best way to say 'block until true'?

2021-03-19 Thread David Storrs
nk of anything but a poll. > > > > -- > > Jay McCarthy > > Associate Professor @ CS @ UMass Lowell > > http://jeapostrophe.github.io > > Vincit qui se vincit. > > > > On Fri, Mar 19, 2021 at 11:59 AM David Storrs > wrote: > > > >

[racket-users] Best way to say 'block until true'?

2021-03-19 Thread David Storrs
Suppose I have a function that tests for some condition, e.g. (define current-user (make-parameter #f)) (define (current-user-set?) (not (false? (current-user))) What is the best way to say "wait until 'current-user-set?' returns true"? I've been through the Events chapter in the Reference and

Re: [racket-users] Word Count program/benchmark performance

2021-03-18 Thread David Storrs
Hi Pawel, I'll take a look at the code later, but did that 21 seconds include startup time for the interpreter? On Thu, Mar 18, 2021, 9:24 AM Pawel Mosakowski wrote: > Hello, > > I am a Racket beginner and I have come across this article: > > >

Re: [racket-users] fluent: unix style pipes and lambda shorthand to make your code more readable

2021-03-09 Thread David Storrs
This is very cool. You might take a look at the `threading` module for additional ideas: https://docs.racket-lang.org/threading/index.html On Tue, Mar 9, 2021 at 10:20 AM Roger Keays wrote: > Hi all, > > I recently publish a new package called *fluent* which adds some syntax > enhancements to

Re: [racket-users] "Unbound Identifier" (Lists)

2021-02-25 Thread David Storrs
dn't understand that")])) (let loop ([history '()]) (display "Input: ") (define input (message (read-line (current-input-port) 'any) "participant" "me")) (display "Chatbot: ") (if (equal? (message-str input) "DONE") (begi

Re: [racket-users] "Unbound Identifier" (Lists)

2021-02-24 Thread David Storrs
Hi IF, I think this is what you want. You were right about the issue -- you were consing onto the history list but then immediately throwing away the result because it wasn't modifying the original history value. #lang racket (struct message (str sender recipient) #:transparent) ; This returns

Re: [racket-users] Verifying the contract on a function

2021-02-24 Thread David Storrs
Aha. That and contract-equivalent? do what I need. Thanks, Sam. On Wed, Feb 24, 2021 at 10:20 PM Sam Tobin-Hochstadt wrote: > You can use the value-contract function, along with contract-stronger? to > do this. > > Sam > > On Wed, Feb 24, 2021, 6:03 PM David Storrs wrote

[racket-users] Verifying the contract on a function

2021-02-24 Thread David Storrs
I have some macros that generate functions. For testing purposes, I'd like to be able to ask the function "Do you have this contract ?" Is there a way to do that? I've been digging through the Contracts section and googled for it but I'm not seeing one. -- You received this message because

[racket-users] Match: non-greedy, and also repeated elements?

2020-12-30 Thread David Storrs
First off, is there a way to make ... in a pattern match non-greedily? i.e., match as *few* elements as possible instead of as many? Second, is there a way to make one pattern refer to an earlier pattern in the same match clause? Semi-regularly I find myself wanting to do something like 'match

Re: [racket-users] Unsafe structs

2020-12-21 Thread David Storrs
The struct-plus-plus module also provides reflection, so you might take a look to see if there are any ideas in there that would be useful for your own module. Accessors are included, as are constructors, rules, wrappers, default values, and predicates. spp has two primary limitations: You

Re: [racket-users] I‘m new to racket, i want to know the best resources of learning racket

2020-12-04 Thread David Storrs
There's also the Racket Guide: https://docs.racket-lang.org/guide/ On Thu, Dec 3, 2020 at 8:45 PM Yi Chen wrote: > Haha, that's for sure. Thanks your suggestion! > Have a nice day:-) > > 在2020年12月4日星期五 UTC+8 上午5:53:36 写道: > >> On Thu, Dec 03, 2020 at 02:19:43AM -0800, Yi Chen wrote: >> > Any

Re: [racket-users] Unusable mail group

2020-11-30 Thread David Storrs
(cc'ing list because this might help others) Note that you can set your gmail account to forward some or all of your email to another account, even one that is not gmail. It's a useful way to aggregate things. On Sun, Nov 29, 2020 at 10:42 PM Albert Wagner wrote: > Yes, thank you, John. I'm

Re: [racket-users] Help implementing an early return macro

2020-10-28 Thread David Storrs
I'm not sure if this is exactly what you want, but the handy module (which I still need to split up into less of a Fibber McGee) includes handy/try. This would let you do the following: #lang racket (require handy/try) (define x (random 100)) ; these are obviously silly functions that are only

Re: [racket-users] [scribble] Are nested lists possible?

2020-10-13 Thread David Storrs
m{foo2 > > @itemlist[ > > @item{bar2} > > @item{baz2}] > > hello2 > > @itemlist[ > > @item{world2}]}] > > > > > > On Tue, Oct 13, 2020 at 10:09 AM David Storrs > > wrote: > > > >

Re: [racket-users] [scribble] Are nested lists possible?

2020-10-13 Thread David Storrs
pain in the ass unless you're expert with it. Sorry for wasting everyone's time. On Tue, Oct 13, 2020 at 1:02 PM David Storrs wrote: > Argh. Wrong code. Please ignore prior message. > > On Tue, Oct 13, 2020 at 12:57 PM David Storrs > wrote: > >> >> >> On

Re: [racket-users] [scribble] Are nested lists possible?

2020-10-13 Thread David Storrs
Argh. Wrong code. Please ignore prior message. On Tue, Oct 13, 2020 at 12:57 PM David Storrs wrote: > > > On Tue, Oct 13, 2020 at 12:48 PM Ben Greenman > wrote: > >> On 10/13/20, David Storrs wrote: >> > @itemlist[ >> > @item{The size

Re: [racket-users] [scribble] Are nested lists possible?

2020-10-13 Thread David Storrs
On Tue, Oct 13, 2020 at 12:48 PM Ben Greenman wrote: > On 10/13/20, David Storrs wrote: > > @itemlist[ > > @item{The size cage needed depends on the type of dog > > @itemlist[ > > @item{Pug: Small} > > @item{Collie: Medium} > > @item{M

[racket-users] [scribble] Are nested lists possible?

2020-10-13 Thread David Storrs
@itemlist[ @item{The size cage needed depends on the type of dog @itemlist[ @item{Pug: Small} @item{Collie: Medium} @item{Mastiff: Large}]}] I would like to produce something that looks like this: - The size cage needed depends on the type of dog - Pug: Small -

  1   2   3   4   5   6   7   8   >