[racket-users] Re: curly-fn language syntax not recognized in the repl

2020-10-20 Thread Greg Hendershott
It looks like this works neither in Dr Racket nor Racket Mode's REPLs. >From a hasty, shallow look, it seems that the curly-fn package uses a convention or protocol defined by the namespaced-transformer package

[racket-users] Re: Problems using (debug-repl) with emacs racket-mode

2020-10-20 Thread Greg Hendershott
To post back to the list, this was resolved: https://github.com/greghendershott/racket-mode/issues/499 On Wednesday, October 14, 2020 at 8:48:43 PM UTC-4, primer wrote: > > I'm trying to use (debug-repl) in the following simple program: > > #lang racket > (require debug/repl) > > (define (add

[racket-users] Re: Racket-mode (emacs) get coverage without using test submodule

2020-10-20 Thread Greg Hendershott
Racket Mode was recently enhanced in this neighborhood: https://github.com/greghendershott/racket-mode/issues/316#issuecomment-691586485 If you upgrade it and that works for you, great. If not feel free to open a GitHub issue about it. (Right now I'm not really able to download that pl.plt

[racket-users] Re: provide-if-not-defined

2020-09-03 Thread Greg Hendershott
What if you instead rename the lang's imports (e.g. with prefix-in), and rely on the fact that your definitions override those supplied by the lang? That way you could write the exact same provide for all the files: "provide-if-not-defined" is simply provide. However, you would need to

[racket-users] Re: find-expr: find a corresponding expression in the definition window

2020-08-31 Thread Greg Hendershott
I might be misunderstanding and the following isn't some fully-thought-out proposal, but: IIUC both #%module-begin and read-eval-print-loop use current-print. What if current-print accepted a new, optional srcloc parameter? And the default #%module-begin were changed to supply this? That way,

[racket-users] Re: combining require, build-path, and namespaces

2020-07-21 Thread Greg Hendershott
Do you definitely want *only* definitions explicitly provide-ed by the module, or is it acceptable (or even desirable) to see *all* module definitions? If the latter, you could use module->namespace. On Tuesday, July 21, 2020 at 11:45:38 AM UTC-4, Shriram Krishnamurthi wrote: > > How I can

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

2020-05-21 Thread Greg Hendershott
Maybe I need more coffee, but a possible heads-up: The current implementation doesn't seem to match the documentation -- wouldn't the with-handlers need to move inside the loop, for it to be infinite? https://github.com/Kalimehtar/thread-utils/blob/master/main.rkt#L35-L41 On Tuesday, May 19,

[racket-users] Re: Question about generating urls with dispatch-rules from imported modules

2020-04-28 Thread Greg Hendershott
Although I haven't tried to use it hands-on, the description of the imperative flavor makes me think it might be intended to help with this? https://docs.racket-lang.org/web-server/dispatch.html#%28part._.Imperative_.Dispatch_.Containers%29 p.s. In general you *can* do mutual requires with

Re: [racket-users] Logger shows lots of info messages about collapsible-contract-bailout and collapsible-value-bailout

2020-04-03 Thread Greg Hendershott
In case it's useful here are some levels for various loggers. '((cm-accomplice . warning) (GC . info) (module-prefetch . warning) (optimizer . info) (racket/contract . error) (sequence-specialization . info)

[racket-users] Re: Best way to handle different versions of Racket?

2020-04-03 Thread Greg Hendershott
> > Is there a standard/recommended way to handle multiple versions of Racket > in library code? > 1. You can use dynamic-require to see if the new thing is actually provided by a module, and in a with-handlers clause substitute your not-found, default behavior. If you do that frequently you

Re: [racket-users] Re: The case, and a proposal, for elegant syntax in #lang racket2

2019-07-25 Thread Greg Hendershott
> I've taught the exact same material at the start of a 3rd year CS PL > course, and the students there didn't find the syntax as easy as one would > hope for students with that much CS “experience”. In fact, unsurprisingly, > many find the syntax as hard as expected for having trained on very >

Re: [racket-users] Racket v7.3.0.900 is available for testing

2019-07-24 Thread Greg Hendershott
> This release is the first one to include Chez-Scheme-based builds > (labeled “Racket CS” on the pre-release page), and we’d be > interested in hearing about any issues you encounter with these > builds. OK, I added a new "RELEASECS" target to travis-racket:

[racket-users] Message in the meantime?

2019-07-23 Thread Greg Hendershott
Although I'm still skeptical that changing the surface syntax will be a sufficiently big net gain, and ought to be the next, highest priority? I'm running with that idea for the following. It seems like there are at least two "flavors" or "strengths", of giving Racket a non-sexpr syntax someday:

Re: Backing up [was: Re: [racket-users] The case, and a proposal, for elegant syntax in #lang racket2]

2019-07-22 Thread Greg Hendershott
[[ Note: I sent this yesterday but the Google list server bounced it. Although I told Matthew I was fine leaving it that way, with only him seeing it, he encouraged me to post it again. ]] Thank you for replying, Matthew. It sounds like surface syntax, other back-ends, and better

Re: Backing up [was: Re: [racket-users] The case, and a proposal, for elegant syntax in #lang racket2]

2019-07-17 Thread Greg Hendershott
Thank you for replying. I didn't mean to suggest I thought these things were already happening. I don't. And I'm sorry my attempt to express gratitude by saying you had every right to decree it, sounded like I thought you actually would do it that way. I don't. I (mis?)understood that working

Re: Backing up [was: Re: [racket-users] The case, and a proposal, for elegant syntax in #lang racket2]

2019-07-16 Thread Greg Hendershott
p.p.p.s or whatever level of "p" I'm on: The core team including Matthew have put decades of work into Racket. The effort and dedication is amazing. So if Matthew wanted to decree that he's been working on this a quarter century and just wants to change surface syntax, next, dammit? I would have

Backing up [was: Re: [racket-users] The case, and a proposal, for elegant syntax in #lang racket2]

2019-07-16 Thread Greg Hendershott
The stated purpose of this change was to increase Racket's popularity. Someone asked, if Racket were already more popular, would this proposal be made? The answer was, probably not. It seems we're jumping over some questions: 1. More popular, among who? [About "research language": Is it

Re: [racket-users] Advice for porting Interactive Brokers API to Racket

2019-07-11 Thread Greg Hendershott
Some systems provide a way to query for a capability: COM has QueryInterface, Racket dynamic-require, Emacs fboundp, and so on. When such a query method is available, you can simply ask for the thing you need or prefer. If it's available, great. If not, act appropriately: Fail, or use your own

Re: [racket-users] Auto-generated AWS SDK

2019-07-10 Thread Greg Hendershott
It's definitely an interesting and smart approach, today. I hope the following doesn't sound defensive; it's just context and observations. Keep in mind that my package dates back to 2012. 1. There were a half dozen AWS services. Of those few, S3 was the 90% use case. 2. There was no API

Re: [racket-users] raise-argument-error missing list?

2019-07-08 Thread Greg Hendershott
I'll chime in only because some of the usual suspects who could best answer this might be busy with the Racket summer school this week. I believe that function contracts can be about as fast as the sort of checks you'd code by hand, provided that: - The parameter contracts are simple, flat,

Re: [racket-users] requirements for streaming html parser

2019-06-06 Thread Greg Hendershott
Although I don't think I currently /need/ a streaming parser for speed or space reasons, I can imagine using one. I'd suggest making something where the user supplies an "on-element" "callback", which is called with each element -- plus the "path" of ancestor elements. The user's callback can do

Re: [racket-users] Trouble writing unhygienic macro

2019-05-27 Thread Greg Hendershott
It seemed like most of your question was about creating the name identifier for the `define`. I focused on (and hopefully answered) that part. But I didn't pick up on what you said the error message was: >> attempts to use with-syntax* also fail with errors like "modified-rst: >> unbound

Re: [racket-users] Trouble writing unhygienic macro

2019-05-27 Thread Greg Hendershott
If users of your `named-query` macro will supply the name as an identifier -- an unquoted symbol like some-name in this example: (named-query (name-line (_ 0) (_ "name") some-name)) Then what your macro needs to do with the pattern variable is... just use it -- as is -- in the template. (It is

Re: [racket-users] Racket Mode documentation

2019-05-24 Thread Greg Hendershott
Sorawee Porncharoenwase writes: > Hmm. I'm seeing "This site can’t be reached" (DNS_PROBE_FINISHED_NXDOMAIN). Instead please try with "www" subdomain: https://www.racket-mode.com/ Although the zone apex (racket-mode.com) was working for me, yesterday, probably I don't have it configured

Re: [racket-users] Re: Racket Mode documentation

2019-05-24 Thread Greg Hendershott
That also looks cool! Definitely a lot of overlap. Maybe some differences: - I'm documenting Emacs major modes (an "app" vs. a lib). So my doc is less concerned with example code that ought to be tested. More concerned with stuff like showing default key bindings. - I wanted the README to

[racket-users] Racket Mode documentation

2019-05-23 Thread Greg Hendershott
Recently I consolidated and updated Racket Mode documentation. It is generated in two formats: - Info: Installed locally. View in Emacs with `C-h i`. - HTML: View at . If you're curious how it's prepared:

Re: [racket-users] First class compound datatypes that can Racket

2019-05-22 Thread Greg Hendershott
Apparently I was too specific and pragmatic. Let me try the opposite: Maybe more general than you want. :) After spending some years with Racket, I've noticed certain things are very popular targets of extension or customization. One is `define`. Another is `struct`. The catch is, these various

Re: [racket-users] First class compound datatypes that can Racket

2019-05-22 Thread Greg Hendershott
Just spitballing here, trying to start with "what's the simplest possible thing that could work?": You could let the user flag a field as the event. I don't know your surface syntax, but maybe using an `#:as-evt` keyword would be OK? You could link/refer the user to the `prop:evt` docs, or,

Re: [racket-users] tip for promoting racket on yc hacker news

2019-05-20 Thread Greg Hendershott
I agree it's good to promote Racket everywhere. At the same time, I recommend folks not take HN too seriously. :) Scanning the links? Often worthwhile. The comments? Sometimes good. Often epic Dunning-Kruger. If you're busy you can instead just read this weekly summary: http://n-gate.com/

Re: [racket-users] Re: Keeping my mind sharp

2019-05-11 Thread Greg Hendershott
Greg Hendershott writes: > Idea: The cool kids these days tend to create an account on GitHub or > GitLab. That way, other folks can see the code and more easily offer > advice. Plus, the commit history is itself a story about your journey > doing this. The commit messages can

Re: [racket-users] Re: Keeping my mind sharp

2019-05-11 Thread Greg Hendershott
Others will have better advice, but a few thoughts: Josh Rubin writes: > I have questions. > (1) Should I be trying to *port* old Scheme code to Racket (a big job) or > should I be *creating a language* that mostly runs the old code as is? As an early "warm-up" step, maybe try to port some

Re: [racket-users] Re: tilda - a threading macro full of itself

2019-05-07 Thread Greg Hendershott
> I like this. Reminds me of `rackjure/threading`, but more involved. A few years ago, after Alexis released https://github.com/lexi-lambda/threading I updated rackjure to re-provide that. Speaking of which, a couple issues there might be interesting for you, Vlad. For example, it's

Re: [racket-users] Module not updating on the package server?

2019-05-01 Thread Greg Hendershott
> Sure. But I'm not looking for the package server to do tests for me, I'm > looking for it to not discourage people from using my package because > there's a red 'fails' next to the name when there shouldn't be. Especially > when it hasn't tried to rebuild the package for two weeks. Probably

Re: [racket-users] Module not updating on the package server?

2019-04-30 Thread Greg Hendershott
Not to speak for Jay, but I think the package server's primary role is to be a catalog server -- "given a package name, I'd like to cash that in for some code". For projects hosted at Git{Hub Lab}, that means the package server needs to know the project URL and the commit digest. It refreshes the

Re: [racket-users] make extensions or replacements

2019-04-21 Thread Greg Hendershott
On Sat, Apr 20, 2019 at 12:02 PM Norman Gray wrote: > On 20 Apr 2019, at 1:11, 'John Clements' via Racket Users wrote: > > > There’s a paper at the most recent ICFP from Simon Peyton Jones (et > > al., I’m guessing) on make languages, IIRC. > > Very interesting -- thanks! The paper is Andrey

Re: [racket-users] make extensions or replacements

2019-04-16 Thread Greg Hendershott
I have a shallow understanding of GNU Make, which is only somewhat less-shallow as a result of recently redesigning my blog to be Makefile-driven. In the process I learned to like using make variables. I learned that a variable can be populated from make functions like $(wildcard) $(patsubst) and

Re: [racket-users] Is there a way to find where some feature is implemented in racket?

2019-04-16 Thread Greg Hendershott
DrRacket: In addition to the open defining file feature that Matthias mentioned, you might like the File | Open Require Path command. racket-mode: M-. aka racket-visit-definition and C-c C-x C-f aka racket-open-require-path are the respective equivalents. [Also C-M-. aka racket-visit-module when

Re: [racket-users] Error location in test submodules

2019-04-04 Thread Greg Hendershott
> Are you using emacs racket-mode? I have experience this issue only in that > mode since it does not (to my knowledge) implement all the error anchoring > features of DrRacket. It might just be that you have DrRacket set to user a higher errortrace level than racket-mode? That is, in DrR,

Re: [racket-users] Pattern: reusing the same name in macro-generated definitions

2019-04-04 Thread Greg Hendershott
If I understand correctly, the fourth paragraph here is relevant? https://docs.racket-lang.org/reference/syntax-model.html#%28part._transformer-model%29 So, `foo-impl` is a binding introduced by the macro and gets that macro invocation's fresh macro-introduction scope. Whereas for example

Re: [racket-users] Error handling for the GUI

2019-03-26 Thread Greg Hendershott
?). And so on.) On Mon, Mar 25, 2019 at 12:00 PM James Platt wrote: > > > On Mar 23, 2019, at 5:49 PM, Greg Hendershott wrote: > > > But -- contract violations aren't like that. They're about some code > > surprising some other code. I think the only hope here is, run the > >

Re: [racket-users] Error handling for the GUI

2019-03-23 Thread Greg Hendershott
Using `exn->string` from `racket/exn` should usually include context ("stack trace")? https://docs.racket-lang.org/reference/exns.html#(def._((lib._racket%2Fexn..rkt)._exn-~3estring)) Also there will be more context to see, if in DrRacket or racket-mode you've selected that higher level.

Re: [racket-users] Thread safe operations and shared memory

2019-03-22 Thread Greg Hendershott
I think this is a pretty good overview of the "stock" choices: https://docs.racket-lang.org/guide/concurrency.html On Fri, Mar 22, 2019 at 8:21 AM George Neuner wrote: > Message passing avoids most share locking issues, so it is better to > implement that way when possible. I agree. Usually

Re: [racket-users] Re: Pretty display of tabular data?

2019-03-15 Thread Greg Hendershott
This is a great idea. Also I want to point out that: 1. Sometimes it's OK to start by sharing a repo on Git{Hub Lab}. Not everything needs to go on pkgs.racket-lang.org immediately, to be visible and share, especially early on. (To be clear, I'm not saying, "oh only perfect 1.0 things should be

Re: [racket-users] Pretty display of tabular data?

2019-03-15 Thread Greg Hendershott
> 90% of the reason I made `raart` is because of this. > > https://docs.racket-lang.org/raart/index.html#%28def._%28%28lib._raart%2Fdraw..rkt%29._table%29%29 > > (require raart > (draw-here (table (text-rows THE-TABULAR-DATA))) Although I didn't see one in the docs, it looks like you have an

Re: [racket-users] What is the best way to "raco make" all *.rkt files in a directory tree?

2019-03-11 Thread Greg Hendershott
I think the best practice (at least my usual practice these days) is to make a package. Say the top of your tree is /path/to/project. Once: raco pkg install /path/to/project Thereafter your "make" is: raco setup --pkgs project This also works fine for c:\path\to\project. (Making it a

Re: [racket-users] define fails at runtime, where let fails at compile time

2019-03-11 Thread Greg Hendershott
To be fair: As a new user, it's possible to have the intuition that `define` is just a way to avoid indentation -- that it "writes a `let` for you, from the point of the define to 'the end of the enclosing scope'". And it's possible for that intuition to seem correct for a very long time --

Re: [racket-users] How to fix typos in documentation?

2019-03-08 Thread Greg Hendershott
I have a dumb question. Why can't doc pages have links whose label is something like "Want to improve the docs?", and the URL goes directly to the appropriate .scrbl file on GitHub? - A .scrbl file knows its own syntax source file path. - defmodule forms know how to make links to the package

Re: [racket-users] Macros that conditionally generate code

2019-03-07 Thread Greg Hendershott
This reminds me of a similar thread on Slack yesterday. When a macro `define`s something, it's usually better for everyone if the identifier is supplied to the macro. It's nicer for you as the macro writer because you don't need to think so hard about scope and hygiene. And it's nicer for the

[racket-users] Is one path a direct or indirect subdirectory of another path?

2019-03-02 Thread Greg Hendershott
What is a portable, correct, efficient way to check whether one path is "under" -- a direct or indirect subdir of -- another path? AFAICT there's no racket/path function for this. Over the years I've done various ad hoc things that seem non-ideal. Including: 1. Use path->string and regexp. 2. Use

Re: [racket-users] Cannot use case+else inside match+else

2019-02-25 Thread Greg Hendershott
Yep, I also spent a non-zero number of years not even realizing "else" wasn't a magic literal for match. And then remembering to use _ instead, as Sorawee suggested. I think this shows why it's usually better for syntax to use #:keywords instead of literals? If cond and case used #:else, this

Re: [racket-users] Re: Help with generators from python land!

2019-02-23 Thread Greg Hendershott
I have zero mileage with Python generators and I don't teach CS. But my understanding is: Sometimes you have a problem where it is nicer to express the solution as two independent pieces: a producer and a consumer that run concurrently. ("Concurrently" doesn't necessarily mean actually in

Re: [racket-users] Use cases for tables and records

2019-02-22 Thread Greg Hendershott
The overall idea sounds great. I don't really understand the motivation for "records" with #:keywords? Maybe you could add a quick explanation about how/when/why they would be preferred over "more Rackety" choices: When the keys aren't known at compile time: - hasheq hash-tables with symbol

Re: [racket-users] test user-interact function dont work

2019-02-17 Thread Greg Hendershott
What does it do? Does `check-equal?` show a failure message? If so, what does it say? I don't know what `refine-main` does, but this simple version works for me: #lang racket (require rackunit) (define (refine-main) (display (read-line))) ;echo (check-equal? (with-output-to-string

Re: [racket-users] Running raco setup from within DrRacket?

2019-02-16 Thread Greg Hendershott
p.s. If you wanted to do a general thing, for DrRacket, this is what I was referring to. The README is probably enough of a hint, you don't need to read the Emacs Lisp. :) https://github.com/purcell/exec-path-from-shell On Sat, Feb 16, 2019 at 10:07 PM Greg Hendershott wrote: > >

Re: [racket-users] Running raco setup from within DrRacket?

2019-02-16 Thread Greg Hendershott
>From unsophisticated searching the source, it looks like the code to implement deps checking is in setup/private/pkg-deps.rkt -- "private" meaning you're not supposed to use it directly. It seems to be called from the `setup-core` function provided by (non-private) setup/setup-core.rkt. That

Re: [racket-users] Questions about Scribble docs

2019-02-16 Thread Greg Hendershott
p.s. As another example of the current breakage: All my own packages that do have documentation, have yellow "This package needs documentation" demerit badges, at the moment. On Sat, Feb 16, 2019 at 9:17 PM Greg Hendershott wrote: > > The package web site seems to think no pa

Re: [racket-users] Questions about Scribble docs

2019-02-16 Thread Greg Hendershott
The package web site seems to think no packages have been built: The "Most recent build results" item is blank for every of the dozen packages I just checked. So I think that's one problem. When that's working normally, as it usually does, there are two levels of refresh: 1. The package

Re: [racket-users] Re: Autocomplete from a list

2019-02-15 Thread Greg Hendershott
If the user will choose very frequently (and you want the fastest UX), and the choices in the database don't change very frequently: It might be worth experimenting with caching the choices in memory. For auto-complete I imagine something like a trie, or whatever the latest hotness might be. The

Re: [racket-users] Wishlist for regexen: x mode, named captures, embeddable regexn

2019-02-14 Thread Greg Hendershott
I often prefer writing non-trivial SQL as s-expressions (using Ryan's `sql` package). I feel the same way about non-trivial regular expressions, and often use the `rx` macro in Emacs Lisp. In Racket, I tend not to write super complicated regular expressions. For example, I started to write a

Re: [racket-users] Some concern about ChezScheme...

2019-02-06 Thread Greg Hendershott
> * As an aside, one of the few times I remember Kent Dybvig making a "joke" in > class was when he introduced the pass "remove complex operands." It was > called "remove-complex-opera*." At Indiana, where Opera is a Thing, I think > it was particularly funny as an inside joke of sorts. He

Re: [racket-users] get-pure-port/headers very slow

2019-01-24 Thread Greg Hendershott
Trying now, it finishes within 1 second for me. I tried on macOS with all of 6.10, 7.1, and a recent-ish build of HEAD, On Thu, Jan 24, 2019 at 5:18 PM Sam Tobin-Hochstadt wrote: > > I investigated this (on linux) by killing the process after 1 and > after 10 seconds, and both were in

Re: [racket-users] Collections and data structures wishlist?

2019-01-23 Thread Greg Hendershott
>> - A separation between using lists as homogeneous collections and using >> lists as fixed-size tuples. So there'd be a separate `tuple?` data type >> that's structurally equivalent to a list but meant to be used differently. >> For example, `(list/c number?)` would mean a list of many

Re: [racket-users] Scribble: ugly spacing due to missing SIntrapara

2019-01-15 Thread Greg Hendershott
On Tue, Jan 15, 2019 at 10:04 AM Sorawee Porncharoenwase wrote: > > Yup. This is exactly the proposal I made above, but you stated it far more > clear :) Whoops. Insufficient coffee. Sorry! -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To

Re: [racket-users] Are the terms "function" and "procedure" synonymous in Racket?

2019-01-15 Thread Greg Hendershott
I feel like every traditional term is subject to "how many angels can dance on the tip of a parenthesis?" debates. For example I prefer "function" but if we rename procedure-arity to function-arity there will be people who complain that 1 is the only correct value. :) There are terms like

Re: [racket-users] Scribble: ugly spacing due to missing SIntrapara

2019-01-15 Thread Greg Hendershott
It seems to me that each of those `defthing`s has reasonably good text. The problem is that the text is in the preceding paragraph, instead of inside `defthing`. The motivation is it's in "user's guide" style not "reference" style. But I'd argue these `defthing` forms belong in reference docs

Re: [racket-users] Re: Functional augmenting

2019-01-09 Thread Greg Hendershott
On Tue, Jan 8, 2019 at 4:35 PM Jens Axel Søgaard wrote: > > Den tir. 8. jan. 2019 kl. 21.40 skrev David Storrs : >> >> >> This. In an ideal world, before/after/around would be parameterized so that >> you can make the change only for a defined scope. >> >> Still, the intent was never that it

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

2018-12-20 Thread Greg Hendershott
There is also the `struct*` pattern: https://docs.racket-lang.org/reference/match.html#(form._((lib._racket%2Fmatch..rkt)._struct*)) On Thu, Dec 20, 2018 at 12:48 AM Philip McGrath wrote: > > On Mon, Dec 17, 2018 at 4:08 PM Jens Axel Søgaard > wrote: >> >> However if you add a field to a

Re: [racket-users] typed racket backend/ir & gpu computing

2018-12-19 Thread Greg Hendershott
What is the "e" in "eDSL"? -- 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 email to racket-users+unsubscr...@googlegroups.com. For more options, visit

Re: [racket-users] How do I (de)serialize PKI keys for storage?

2018-12-18 Thread Greg Hendershott
Maybe it is a limitation of libgcrypt? All three return #t for me when using libcrypto: (require crypto crypto/libcrypto) (crypto-factories libcrypto-factory) Although I don't know the pros and cons of each, it seems the libcrypto pros include this working, as well as it being installed by

Re: [racket-users] embedded api docs and the `doc` submodule

2018-11-30 Thread Greg Hendershott
Are you familiar with the existing `srcdoc` submodule? https://docs.racket-lang.org/scribble/srcdoc.html If so: I'm curious, what are your thoughts behind not using it? If not: The existing `scribble/srcdoc` interface works, but I think there's definitely an opportunity to build some

Re: [racket-users] minor doc change proposal?

2018-11-30 Thread Greg Hendershott
On Fri, Nov 30, 2018 at 5:58 AM Robby Findler wrote: > What about using the function > > (lambda (x) (and x #true)) > > And putting a short discussion of truthy and a link to elsewhere in the docs? Yeah. I feel like the `filter-map` doc would be fine with just that change. Already it tells you

Re: [racket-users] Re: How do I launch a REPL in the context of a file?

2018-11-30 Thread Greg Hendershott
If you have xrepl enabled (it is by default in recent Rackets), you get a bunch of handy commands. Try entering ,help to see them. One is ,enter. So one common workflow is you keep one `racket` process running all the time, and simply type `,en /path/to/to/file.rkt` at the prompt. If typing `,en

Re: [racket-users] Loggers that don't prepend?

2018-11-26 Thread Greg Hendershott
make-log-receiver returns a synchronizable event; you start a thread to loop and sync on that. Formatting and disposition is up to you. 1. Example from XREPL, displaying to stdout with `;` comment chars prepended:

Re: [racket-users] Racket application servers

2018-11-25 Thread Greg Hendershott
I just want to point out the possibility that your Racket web app might not be CPU-bound. Some "generic" web sites are IO-bound. Blocked on IO for the HTTP requests and responses. Blocked on IO talking to a database server like Postgres. In cases like that, you might not need more than one

Re: [racket-users] Racket application servers

2018-11-23 Thread Greg Hendershott
In my experience a Racket web server will just stubbornly continue to work for months at a time, if you let it. (Reminds me of the aviation joke. In the future, cockpits will have just one human pilot and a dog. The dog is there to bite the human if they try to turn off the autopilot.) I have a

Re: [racket-users] Destructuring a list in (for ...)

2018-11-23 Thread Greg Hendershott
> The trouble, sadly, is that this grammar is ambiguous. In > > (for ([(x y) s]) > ) > > should (x y) be parsed as a single match pattern or as two binders for a > two-valued sequence (such as one produced by in-hash, for example)? Unless I'm being dense, (x y) isn't a valid single

Re: [racket-users] Destructuring a list in (for ...)

2018-11-22 Thread Greg Hendershott
> (define-syntax (match-for stx) That's nice. Sometimes I wish I could do the general thing -- use `match` patterns in the binding clauses for any `for`-family form. I often do something like this: (define xs (list (cons 1 2) (cons 3 4))) (for ([x (in-list xs)]) (match-define

Re: [racket-users] unit testing output

2018-11-06 Thread Greg Hendershott
On Fri, Nov 2, 2018 at 3:38 PM Neil Van Dyke wrote: > * Should such a failing message also have some way of click navigating > to the test failure in DrRacket, like for exceptions? (Note that the > answer to the next might be involved.) Yes please! It is no fun finding a failing test source in

Re: [racket-users] distributed computation support for handin-server?

2018-10-23 Thread Greg Hendershott
Have you considered some sort of yield-management incentive, such as offering a higher grade to students who submit during less-busy periods? :P Although I don't know anything about the handin server, or very much about load-balancing, just riffing: A simple round-robin HTTP proxy probably

Re: [racket-users] Scribble xref links in frog

2018-10-08 Thread Greg Hendershott
Is this for .md or .scrbl sources? If scribble: It's been some years since I worked on this, but at a quick glance Frog is running Scribble with --redirect-main http://docs.racket-lang.org/ https://github.com/greghendershott/frog/blob/master/frog/private/read-scribble.rkt So I'm not sure

Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-08 Thread Greg Hendershott
p.s. On Mon, Oct 8, 2018 at 11:41 AM Greg Hendershott wrote: > Another use case (that Mattias might not love) is somewhere for "usage Apologies for the typo, Matthias! -- You received this message because you are subscribed to the Google Groups "Racket Users" group. T

Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-08 Thread Greg Hendershott
Sexpr comments are interesting because people want them to act mostly like sexprs -- for indentation, and for structural editing/display like paredit or rainbow-parens. At most they should look like comments. Or not even that. As this thread shows. :) Another use case (that Mattias might not

Re: [racket-users] add set-subset?

2018-10-05 Thread Greg Hendershott
Could we add a macro to allow defining alias names? Could call it `set!-set-subset?`. And probably want a way to see all such aliases: `get-set!-set-subset?-set-subs`. p.s. In all seriousness, the doc redirect is a great idea. -- You received this message because you are subscribed to the

Re: [racket-users] servlet development in REPL

2018-10-04 Thread Greg Hendershott
I just wanted to chime in and say I share Philip's preference. I think programming is hard enough without multiple sources of truth. p.s. Replacing expensive startup items with a no-op is a good idea. Or sometimes, keep the "real-op" but postpone using one of: - `delay/sync` and `force` from

Re: [racket-users] Why does my package have no build status?

2018-10-04 Thread Greg Hendershott
> As to the dependency, there's no reason that people need to have > handy/test-more (the testing framework I use for struct-plus-plus) installed > in order to use the module. Would it help to put `handy` in `build-deps` instead of `deps`? > It's not clear to me how to use compile-omit-files

Re: [racket-users] Is there a way to enter! a file from the command line?

2018-09-08 Thread Greg Hendershott
> racket --repl --eval '(enter! "foo.rkt")' Also, you could simply `racket --repl` once. In recent versions of Racket, XREPL is enabled by default. It has commands like `,enter` that you could use if you can arrange for vscode to send text to the racket input port. (This is how very early

Re: [racket-users] Is there a way to enter! a file from the command line?

2018-09-08 Thread Greg Hendershott
You could do racket --repl --eval '(enter! "foo.rkt")' -- 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 email to racket-users+unsubscr...@googlegroups.com. For more

Re: [racket-users] What does `raco test file.rkt` do by default if no `test` submodule?

2018-09-06 Thread Greg Hendershott
> I am starting to use raco test for testing, and found out that in a file > without (module test ...), it may run some kind of test on the file. But for > some files, raco test reports that it ran a test, for others however no test > is run. > > Right now I am now adding a (module test

Re: [racket-users] Security of continuation web server?

2018-09-02 Thread Greg Hendershott
1. The web server FAQ has a brief section about this: https://docs.racket-lang.org/web-server/faq.html#%28part._.What_special_considerations_are_there_for_security_with_the_.Web_.Server_%29 2. SSL is good to use in any case. Even if you believe your site doesn't handle any sensitive user

Re: [racket-users] Using match on hash tables with optional keys

2018-09-01 Thread Greg Hendershott
>(define not-found (gensym 'not-found)) >(define (not-not-found? x) (not (eq? x not-found))) > ... > #'(app (lambda (h) (hash-ref h key not-found)) >(? not-not-found? value-pattern))) Oh dang. I shouldn't not have thought of that. Nice! -- You

Re: [racket-users] Using match on hash tables with optional keys

2018-08-30 Thread Greg Hendershott
A general trick for optional values with match is something like (or pat (app (λ _ default-value) pat)). But that doesn't work for hash-table which uses [pat path] for each mapping. (At least I couldn't see how.) Here's _a_ way you could write this as a match pattern: (define ((hash-has-keys?

Re: [racket-users] Where to put scribblings in 'multi package?

2018-08-29 Thread Greg Hendershott
Also there's some history, IIRC: Early on, multi collection packages were the only kind. Even an actively maintained package might stick with this, to continue to support older versions of Racket. Same story for info.rkt files using #lang setup/infotab instead of #lang info. -- You received this

Re: [racket-users] Legal/Business Case Management DSLs

2018-08-25 Thread Greg Hendershott
Hi, Richard. My initial reaction is that the full scope of what you described would be a very ambitious project -- it would take a lot of time and people to do and maintain over time. Are there existing commercial or open-source software systems to run a small to medium sized law practice? If

Re: [racket-users] From Clojure to Racket

2018-08-23 Thread Greg Hendershott
Sorry -- realized I missed your last paragraph. I like other people's suggestions so far and will try to write up more later. On Thu, Aug 23, 2018 at 3:47 PM Greg Hendershott wrote: > > This is a bit rough and old but: > > https://github.com/greghendershott/racket-clojure

Re: [racket-users] From Clojure to Racket

2018-08-23 Thread Greg Hendershott
This is a bit rough and old but: https://github.com/greghendershott/racket-clojure-cheat-sheet -- 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 email to

Re: [racket-users] Converting Windows line-endings for arbitrary ports

2018-08-16 Thread Greg Hendershott
Could you use `read-line`, supplying 'any for the optional `mode` argument? https://docs.racket-lang.org/reference/Byte_and_String_Input.html#(def._((quote._~23~25kernel)._read-line)) If reading in line-sized chunks would be awkward for your existing code: I suppose you add a second pipe

Re: [racket-users] Question about style

2018-08-16 Thread Greg Hendershott
Have you ever considered extending the grammar of define from this: (define id expr) (define (head args) body ...+) To this: (define id expr ... ...); <-- like e.g. `hash` (define (head args) body ...+) So we could write things like: (define x 0 y 1 z 2) Sometimes so much

Re: [racket-users] Re: how to show raco full (non-abbreviated) error messages

2018-08-13 Thread Greg Hendershott
o 'high to run with errortrace all the time; the gotcha is your program will run more slowly.) On Mon, Aug 13, 2018 at 1:25 AM Greg Hendershott wrote: > > > given procedure: ...amm-3.1/util.scm:58:6 > > It seems you had something like `(map (lambda (x) x) (list 1 2 3) > (l

Re: [racket-users] Re: how to show raco full (non-abbreviated) error messages

2018-08-12 Thread Greg Hendershott
> given procedure: ...amm-3.1/util.scm:58:6 It seems you had something like `(map (lambda (x) x) (list 1 2 3) (list 1 2 3))` and the error message wants to show the name of the function. What is the name of an anonymous function? That sounds like a Zen koan. But there is an automatically

Re: [racket-users] Question about style

2018-08-12 Thread Greg Hendershott
As others said, naming intermediate values can make things clearer. (Taken too far, maybe it's hard to see the forest for the trees? I think it depends on the audience and the domain.) You happened to choose an example that illustrates a reason maybe not to do this with let* or define -- cleaning

  1   2   3   >