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

2022-01-05 Thread Philip McGrath
Hi, On Thu, Dec 30, 2021 at 3:33 PM 'Wayne Harris' via Racket Users < racket-users@googlegroups.com> wrote: > I'm considering writing a manager for background processes --- such as > send a batch of e-mail or other process that takes a while to finish --- > for a web system. > > I see the

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

2021-11-22 Thread Philip McGrath
On Monday, November 22, 2021 at 10:16:49 AM UTC-5 Jens Axel Søgaard wrote: > There is no need to rush things however. > In due course maybe the number of users on the forum will > grow to outshadow the number of participants on the mailing list, > but it will take some years. > This was my

Re: [racket-users] Racket Discourse

2021-11-21 Thread Philip McGrath
I've long been in the basically-content-with-the-mailing-list camp, but I've recently come around to the view that the status quo is untenable. I looked into it after Racket 'Con and discovered the mailing list had shrunk especially much for me, because the Google Groups spam filters were letting

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

2021-11-11 Thread Philip McGrath
On Thu, Nov 11, 2021 at 9:20 PM Yushuo Xiao wrote: > Thank you very much! I didn't know the set is not fixed. And thinking of > them as an IR really helps. > > On Friday, November 12, 2021 at 12:15:39 AM UTC+8 johnbclements wrote: > >> That’s a true statement… but that set is by no means fixed.

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

2021-10-26 Thread Philip McGrath
On Tue, Oct 26, 2021 at 1:30 PM Sage Gerard wrote: > > Jon: I'm guessing you haven't actually tried this > > Phillip: I guess the check doesn't happen as part of `tz/c`, but I can > tell you that this program > > Yes, but I'm talking about code we were asked to give feedback on. I focus > on

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

2021-10-26 Thread Philip McGrath
On Tue, Oct 26, 2021 at 12:01 PM Sage Gerard wrote: > >- The IANA's timezone database changed this month, and gregor's last >commit was 2 years ago. > > My comment was not meant to say that timezone math is easy to replace, or > even that gregor isn't a fit. It's to say that I'm not

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

2021-10-26 Thread Philip McGrath
Excited to try this! Generating Atom and RSS feeds is on the to-do list for one of my current projects. On Mon, Oct 25, 2021 at 10:25 PM 'Joel Dueck' wrote: > >- MIME types: Yes, I should use/add a more complete extension→type >mapping, though I probably will continue not to validate

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

2021-09-28 Thread Philip McGrath
On Tue, Sep 28, 2021 at 3:30 PM Ben Greenman wrote: > On 9/28/21, David Storrs wrote: > > $ raco pkg remove try-catch > > raco pkg remove: invalid `deps' specification > > specification: '("base" racket/format racket/string) > > > > That is not the deps specification from the info.rkt file so

Re: [racket-users] Can a new user defined pkg encompass nothing more than references to previously defined pkgs?

2021-06-07 Thread Philip McGrath
On Mon, Jun 7, 2021 at 1:46 PM Don Green wrote: > Following from Philip's 3rd point, which I think is very relevant, I > surmise that I really should: > 1) build libraries ;that reference my code (These libraries are built > within a user-defined package.) > This seems right, though I would say

[racket-users] Should minimal Racket include "base"?

2021-06-07 Thread Philip McGrath
There seems to be an inconsistency about whether "minimal Racket" includes the "base" package. The downloads for Mac OS and Windows seem to include it, but both the Linux downloads and the source tarballs have only "racket-lib". I know that Mac OS, Windows, and "natipkg" use the "racket-lib"

Re: [racket-users] Could Racket be used as a "frontend" for a non-Racket language?

2021-06-06 Thread Philip McGrath
I haven't done much with this personally, but a few pointers in Racket: - Urlang uses Racket's macro system as a front-end for JavaScript (in the way you discuss with C#, not compiling Racket to JavaScript): https://github.com/soegaard/urlang - Alexis King's Hackett is an experimental

Re: [racket-users] Can a new user defined pkg encompass nothing more than references to previously defined pkgs?

2021-06-06 Thread Philip McGrath
On Sun, Jun 6, 2021 at 7:59 PM Ben Greenman wrote: > On 6/6/21, Don Green wrote: > > > > Can a new user defined pkg encompass nothing more than references to > > previously defined pkgs so that every user created module references a > > single user defined pkg? > > Yes. You can make a new

Re: [racket-users] Cross-VM method for sending any input port to C runtime?

2021-05-23 Thread Philip McGrath
On Sun, May 23, 2021 at 7:57 PM Matthew Flatt wrote: > At Sun, 23 May 2021 14:57:42 +, Sage Gerard wrote: > > Is there a cross-VM way to pass an arbitrary input port to the C > > runtime (e.g. via open-input-bytes), such that the C runtime can read > > bytes on its own? > > No, not unless

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

2021-05-18 Thread Philip McGrath
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, you don't want to support that at all … > Then you can use

Re: [racket-users] Packages not being listed after reinstalling

2021-05-15 Thread Philip McGrath
Hi! I have been working on Guix's packaging of Racket, though I'm not especially experienced with Guix. The ssl-connect issue sounds like it may be related to §2.6 "Application Setup" in the Guix manual, especially the subsections about "X.509 Certificates" and perhaps the "Name Service Switch":

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

2021-05-09 Thread Philip McGrath
Here's another minimally-tested sample implementation. A more robust solution might try to chaperone the struct type, as well, to protect reflective access to the constructor—but I wonder if that really makes sense when you are working with prefab structs. If you can explain more about your

Re: [racket-users] Is this a good uninstall then install Racket plan...

2021-04-13 Thread Philip McGrath
On Tue, Apr 13, 2021 at 10:31 PM John Clements wrote: > What if he has directories that aren’t part of an installed package? That > was my concern, and why I suggested manually deleting compiled subdirs. > That's right, but given: On Tue, Apr 13, 2021 at 8:16 PM Don Green wrote: > Welcome to

Re: [racket-users] Is this a good uninstall then install Racket plan...

2021-04-13 Thread Philip McGrath
On Tue, Apr 13, 2021 at 8:21 PM 'John Clements' via Racket Users < racket-users@googlegroups.com> wrote: > It sounds to me like the solution might be much much simpler than > re-installing an earlier version of racket. Here’s what I recommend. > > 1) Delete all of the “compiled” subdirectories in

Re: [racket-users] Re: Executable file size and raco demod

2021-04-07 Thread Philip McGrath
On Tue, Apr 6, 2021 at 7:54 PM Matthew Flatt wrote: > In the cross-compilation path that the release builds use, there was an > unintended layer of compression. (I noticed the size difference before, > but had not yet investigated.) Checking that again, if the extra layer > is used, the 10% or

Re: [racket-users] Version metadata on Racket packages

2021-03-16 Thread Philip McGrath
Hi Jeff, In fact there are two concepts here, and part of what I think confused you is something I just discovered this week and plan to report as a bug: https://pkgs.racket-lang.org/pkgs-all does not include the package's version: that's what's discussed on the Package Concepts

Re: [racket-users] bytevector-uncompress: internal error uncompressing

2021-03-15 Thread Philip McGrath
I've submitted a patch at https://issues.guix.gnu.org/47180 that I hope will resolve this issue. -Philip -- 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] bytevector-uncompress: internal error uncompressing

2021-03-15 Thread Philip McGrath
Aha! Running: guix environment --ad-hoc --no-grafts racket -- drracket launches DrRacket just fine. My guess is that Racket CS is compressing string literals in compiled code. Currently, Guix patches Racket source files to include the absolute paths to foreign libraries in the store as

Re: [racket-users] bytevector-uncompress: internal error uncompressing

2021-03-15 Thread Philip McGrath
I can reproduce the error with just: ``` $ racket -l mred/private/wx/gtk/utils $bytevector-uncompress: internal error uncompressing

Re: [racket-users] bytevector-uncompress: internal error uncompressing

2021-03-15 Thread Philip McGrath
Jack, thanks for the pointer: I hadn't noticed this earlier. On 3/15/21 12:49 AM, Jack Hill wrote: ``` $bytevector-uncompress: internal error uncompressing

Re: [racket-users] Is it safe to `read` untrusted input?

2021-03-05 Thread Philip McGrath
If you don't need the on-the-wire form to be human-readable, you should look at `racket/fasl`: https://docs.racket-lang.org/reference/fasl.html It can handle all of the acyclic data that `read` and `write` can (plus a little extra), it *doesn't* have `read`'s many configuration parameters that

Re: [racket-users] Unsafe structs

2020-12-21 Thread Philip McGrath
On Mon, Dec 21, 2020 at 7:30 PM Robby Findler wrote: > Is Typed Racket able to prove that your use of unsafe accessors is > actually safe? > On a similar note, my understanding is that, even without types, in a program like this: #lang racket (struct cell (val)) (λ (x) (if (cell? x)

Re: [racket-users] DrRacket caret blink

2020-11-28 Thread Philip McGrath
:49:39 PM UTC-5 Philip McGrath wrote: > On Sat, Nov 28, 2020 at 3:10 PM 'Mark' via Racket Users < > racket...@googlegroups.com> wrote: > >> (But it is still a pity that there's no config option to turn off >> blinking in DrRacket.) >> > > I agree that

Re: [racket-users] DrRacket caret blink

2020-11-28 Thread Philip McGrath
On Sat, Nov 28, 2020 at 3:10 PM 'Mark' via Racket Users < racket-users@googlegroups.com> wrote: > (But it is still a pity that there's no config option to turn off blinking > in DrRacket.) > I agree that this would be a valuable feature to add, not just to DrRacket but to `racket/gui` in

Re: [racket-users] Namespaces and modules

2020-11-15 Thread Philip McGrath
I think you’ll need `define-runtime-module-path` or `define-runtime-module-path-index` to alert the executable builder to the dynamic dependency. On Sun, Nov 15, 2020 at 3:38 AM Dominik Pantůček < dominik.pantu...@trustica.cz> wrote: > > > > > Using ''sandbox as an argument to

Re: [racket-users] Contracts for (partially) specifying dictionary key -> value-predicates

2020-10-30 Thread Philip McGrath
I've wanted this several times (and written more than one ad-hoc partial version): a general-purpose combinator would be great! On Fri, Oct 30, 2020 at 1:14 PM William J. Bowman wrote: > > 1. make these functions, not macros > The main implementation is a procedure, but I think I need a macro

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

2020-10-28 Thread Philip McGrath
The most similar example that comes to mind is the way `for`-like forms handle the `body-or-break` nonterminal to support `#:break` and `#:final`. In particular, I think you would end up needing something analogous to these semantics for definitions

Re: [racket-users] Hygiene for a curried macro

2020-09-30 Thread Philip McGrath
Shot 2020-09-30 at 3.47.40 AM.png] -Philip On Wed, Sep 30, 2020 at 3:40 AM Philip McGrath wrote: > Hi Nia, > > Here's a variant that passes your test: > > #lang racket > > (require rackunit > syntax/parse/define) > > (define-syntax let-second-and-create-let-thir

Re: [racket-users] Hygiene for a curried macro

2020-09-30 Thread Philip McGrath
Hi Nia, Here's a variant that passes your test: #lang racket (require rackunit syntax/parse/define) (define-syntax let-second-and-create-let-third (syntax-parser [(_ var let-third body-of-let-second) #'(let ([var "second"]) (let-syntax ([let-third

Re: [racket-users] Why are these @defthing blocks typeset incorrectly?

2020-09-23 Thread Philip McGrath
I have encountered this problem. I don't have a real solution, but maybe my hacky solution will be good enough. On Wed, Sep 23, 2020 at 7:37 PM Sorawee Porncharoenwase < sorawee.pw...@gmail.com> wrote: > I think Scribble uses source location equipped with syntax objects to > figure out spacing.

Re: [racket-users] package manager woes on Windows 10?

2020-09-10 Thread Philip McGrath
Also, this is happening over encrypted HTTPS: no one is sniffing the User-Agent header. My initial attempt to reproduce in the GUI package manager was foiled because I’d first tried installing at the command line, and the package manager used a cached copy of the repository. From Shriram’s update

Re: [racket-users] locally linked package name doesn't match info collection name

2020-09-09 Thread Philip McGrath
There was a `pkg-name` info.rkt item added in 20672cd , but it only seems to be used by `make-dirs-catalog`

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

2020-09-02 Thread Philip McGrath
On Wed, Sep 2, 2020 at 3:41 PM Christopher Lemmer Webber < cweb...@dustycloud.org> wrote: > Unfortunately I can't use #:methods with struct/contract so I'm stuck > with the slow one if I want a contract on the struct? > For another option (though you may already know this), I'd advocate for

Re: [racket-users] abstraction suggestion?

2020-08-31 Thread Philip McGrath
tty clever! A bit painful, but clever! > > On Mon, Aug 31, 2020 at 1:32 PM Philip McGrath > wrote: > >> There might be a better way, but I'd probably make a language for writing >> this kind of module, in the spirit of `#lang syntax/module-reader`, where >> its `#%module-be

Re: [racket-users] abstraction suggestion?

2020-08-31 Thread Philip McGrath
There might be a better way, but I'd probably make a language for writing this kind of module, in the spirit of `#lang syntax/module-reader`, where its `#%module-begin` would expect the module body to be ``, similar to the way that the body of `(module reader syntax/module-reader

Re: [racket-users] lsp server

2020-08-16 Thread Philip McGrath
On Fri, Jul 31, 2020 at 2:46 PM Catonano wrote: > I'm playing with a toy project in #Racket > > I'd like to use the lsp server… > how do I connect to it from my Emacs based client ? > Just in case by "use the lsp server" you meant "set up Emacs to work on a

Re: [racket-users] Advice wanted about new opengl binding

2020-08-03 Thread Philip McGrath
Is this what you're looking for? https://pkgs.racket-lang.org/package/sgl -Philip On Sun, Aug 2, 2020 at 5:51 PM Hendrik Boom wrote: > Time to rethink everything before I go further. > > So far I've found several opengl bindings. > There's opengl, documented here: >

Re: [racket-users] pictures in code?

2020-08-03 Thread Philip McGrath
On Mon, Aug 3, 2020 at 9:47 AM Hendrik Boom wrote: > On Sun, Aug 02, 2020 at 08:58:54PM -0700, Sorawee Porncharoenwase wrote: > > For DrRacket, it's possible via "Insert > Insert Image". It's been used > in > > HtDP. See https://htdp.org/2020-8-1/Book/part_prologue.html > > Now that's presumably

Re: [racket-users] Working out which directory the current code was loaded from?

2020-07-27 Thread Philip McGrath
For this particular purpose, you want `define-runtime-path`: https://docs.racket-lang.org/reference/Filesystem.html#%28part._runtime-path%29 -Philip On Mon, Jul 27, 2020 at 9:38 PM Peter W A Wood wrote: > I have a short racket program/script that reads a file from the directory > in which it

Re: [racket-users] Are Regular Expression classes Unicode aware?

2020-07-09 Thread Philip McGrath
On Thu, Jul 9, 2020 at 10:32 AM Sorawee Porncharoenwase < sorawee.pw...@gmail.com> wrote: > Racket REPL doesn’t handle unicode well. If you try (regexp-match? > #px"^[a-zA-Z]+$" "héllo") in DrRacket, or write it as a program in a file > and run it, you will find that it does evaluate to #f. > See

Re: [racket-users] Re: Andy Wingo's fold

2020-06-25 Thread Philip McGrath
On Sun, Jun 14, 2020 at 2:20 PM Catonano wrote: > I'm referring to a paper titled: "A better XML parser through functional > programming" > > by Oleg Kiselyov > Ah, I see. I'm not deeply familiar with it myself (I mostly use Racket's `xml` library), but there is a Racket port of Oleg's SSAX,

Re: [racket-users] Re: Andy Wingo's fold

2020-06-12 Thread Philip McGrath
On Fri, Jun 12, 2020 at 2:46 AM Catonano wrote: > the original paper Andy Wingo refers to uses Haskell to express this > operator and I can't read Haskell and I'm not willing to learn > I'm confused about what you mean: in the version of "Applications of Fold to XML Transformation", on Andy

Re: [racket-users] syntax woe with typed Racket 'let'

2020-06-02 Thread Philip McGrath
On Mon, Jun 1, 2020 at 3:48 PM Sam Tobin-Hochstadt wrote: > (define (f [x : Number] . [y : String *]) : Number (+ x (length y))) > Another way to write this, which I often prefer, is: > (: f (-> Number String * Number)) > (define (f x . y) > (+ x (length y))) > -- You received this

Re: [racket-users] Re: Is it possible to make submodules with private names?

2020-05-23 Thread Philip McGrath
On Sat, May 23, 2020 at 5:04 PM Simon Schlee wrote: > I also would find it interesting to have something functor like, in the > sense of being able to create parameterized module instances. > My guess is that constructs like that are difficult to optimize and the > separation between runtime and

Re: [racket-users] trickiness about the order of definitions in GUI code

2020-05-06 Thread Philip McGrath
On Wed, May 6, 2020 at 8:49 PM Jon Zeppieri wrote: > It's a bit trickier to define these things in separate files, because > their definitions refer to each other (though indirectly in this > case), and the module system does not tolerate cyclic dependencies. > The most straightforward way to

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

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

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

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

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

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

Re: [racket-users] Do I misunderstand set! ?

2020-04-23 Thread Philip McGrath
I think you are running into the (very confusing!) issue Ben describes here: https://groups.google.com/d/msg/racket-users/UD20HadJ9Ec/mDd4x8Y1BwAJ -Philip On Thu, Apr 23, 2020 at 5:00 PM Hendrik Boom wrote: > extract from code: > > (fprintf anomaly "resEEEulttyope was ~s~n"

Re: [racket-users] Examples of sending HTML email w/ Racket?

2020-04-09 Thread Philip McGrath
I put up an example taken from my code for Digital Ricoeur in response to an old mailing list thread . It is not ready for general-purpose use—in particular, I basically only have to deal with trusted input—but here it is:

Re: [racket-users] Scribble citations for art history dissertation (AJA style)

2020-03-19 Thread Philip McGrath
On Thu, Mar 19, 2020 at 12:40 PM Matthew Flatt wrote: > At Thu, 19 Mar 2020 12:38:39 -0400, Christopher Lemmer Webber wrote: > > I will spend the rest of the day looking at what scriblib's bibliography > > stuff does in further detail and think about how to accomplish what we > > need. It could

Re: [racket-users] Types for formlets

2020-02-24 Thread Philip McGrath
Hi Marc, You're right that there will be some challenges in using formlets in Typed Racket. The easiest approach will probably be to keep defining formlets in untyped modules and importing them with `require/typed`, perhaps with helper functions or macros to eliminate some of the boilerplate.

Re: [racket-users] Starting syntax highlighter project

2020-02-19 Thread Philip McGrath
You don't need a `#lang` to use `color:text<%>`: I've used it to do basic syntax highlighting for XML. In fact, you don't even need a GUI for the relevant part of the protocol, which is what `#lang`s implement. The requirements are described in the documentation

Re: [racket-users] cast on mutable hash table...

2020-02-15 Thread Philip McGrath
On Sat, Feb 15, 2020 at 1:23 PM 'John Clements' via users-redirect < us...@plt-scheme.org> wrote: > Yes, absolutely. One reason that students in my class wind up using cast > quite frequently in their parsers is that they use patterns like (list (? > symbol s) …) which (as I recall) expand into

Re: [racket-users] Re: How to convert String to Integer

2020-02-11 Thread Philip McGrath
On Tue, Feb 11, 2020 at 3:28 PM Alain De Vos wrote: > But first i need a list of characters. :) > Does the language has a conversion operator ? > Yes, `string->list`: https://docs.racket-lang.org/reference/strings.html#(def._((quote._~23~25kernel)._string-~3elist)) But read on … On Tue, Feb

Re: [racket-users] How to convert String to Integer

2020-02-11 Thread Philip McGrath
Others have tried to be more Socratic in pointing you this way, but here's an attempt at being more explicit. As you note, the result of `string->number` has the type `(U Complex False)`. If we try to think about about this in a version of the HtDP design recipe, we have a few cases: 1.

Re: [racket-users] [racket users] Macro literal "|"

2020-02-03 Thread Philip McGrath
You're right that `|` isn't a valid terminal with the normal reader, but, as it happens, the zero-length identifier can be written as `||`. (I don't think the concept of a zero-length identifier is common in other languages: it corresponds to the empty string.) -Philip On Mon, Feb 3, 2020 at

Re: [racket-users] Web server + authentication

2020-01-22 Thread Philip McGrath
I configure Postfix to send external mail via Amazon's "Simple Email Service," then use `net/sendmail`. Having a working mail-transfer agent means you can easily send yourself mail from other tools on the system, too, like a cron job to renew the TLS certificates. (I haven't looked at Postmark, so

Re: [racket-users] Can I somehow connect to and update values in a specific hash table used by a running web server?

2019-12-22 Thread Philip McGrath
The other advice here is good and could help to implement a more principled solution. But, if you want to do something equivalent to editing a running application's database on the fly, just using Racket values instead of a DB, I would build on `file-box`:

Re: [racket-users] Change error message of web server continuations from "Sorry, this page has expired. Please go back."

2019-12-22 Thread Philip McGrath
You can probably use `make-threshold-LRU-manager ` with a much higher memory threshold than the default from `serve/servlet`, which is about

Re: [racket-users] xml library clarification - "" symbol parsing

2019-11-22 Thread Philip McGrath
On Fri, Nov 22, 2019 at 8:50 AM Neil Van Dyke wrote: > That hypothetical parser assembling the parsed representation *could* > then concatenate sequences of 2 or more contiguous strings representing > CDATA, but that could be expensive, and might not be needed. Consider > how large some XML and

Re: [racket-users] What's the best way to do these syntax transforms?

2019-11-08 Thread Philip McGrath
On Fri, Nov 8, 2019 at 5:06 PM Christopher Lemmer Webber < cweb...@dustycloud.org> wrote: > Huh... somehow I had thought that I had heard that Racket has mutable > strings by default. It cropped up on my TODO list because of that. I > wonder what gave me that impression? > Racket strings are

Re: [racket-users] What's the best way to do these syntax transforms?

2019-11-08 Thread Philip McGrath
On Fri, Nov 8, 2019 at 2:58 PM Matthew Flatt wrote: > More precisely, the reader (via `read-syntax`) creates immutable > strings. > > If a macro constructs a mutable string and converts it to a syntax > object, the string is not converted to an immutable string. Maybe it > should be. > I see

Re: [racket-users] What's the best way to do these syntax transforms?

2019-11-08 Thread Philip McGrath
On Fri, Nov 8, 2019 at 9:56 AM Jay McCarthy wrote: > On Fri, Nov 8, 2019 at 9:51 AM Christopher Lemmer Webber < > cweb...@dustycloud.org> wrote: > >> I have a need to do two things in a #lang: >> >> - Most importantly, make all strings that appear in the source code >>immutable >> > > Make

Re: [racket-users] eq? of quoted expressions

2019-10-25 Thread Philip McGrath
On Fri, Oct 25, 2019 at 1:27 PM wanderley.guimar...@gmail.com < wanderley.guimar...@gmail.com> wrote: > On Fri, Oct 25, 2019 at 9:28 AM Alexis King wrote: > >> Unlike eq? on symbols, eq?’s behavior on quoted lists is unspecified … >> Is there a reason you would like the answer to be #t? > > Not

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

2019-10-10 Thread Philip McGrath
On Thu, Oct 10, 2019 at 2:42 AM Zelphir Kaltstahl < zelphirkaltst...@gmail.com> wrote: > … If that works for arbitrary serializable-lambda with only serializable > parts, I could continue my process pool project. > Yes, this would work for any value created by `serial-lambda`. > The only issue

Re: [racket-users] How do I typeset mixed-code for docs.racket-lang.org?

2019-10-09 Thread Philip McGrath
The way I would approach this would probably be to: 1. Create a #lang that accepts your source Markdown+Racket syntax. 2. Add a color lexer as you would for DrRacket, probably using ` syntax-color/racket-lexer

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

2019-10-09 Thread Philip McGrath
On Wed, Oct 9, 2019 at 2:09 PM Zelphir Kaltstahl wrote: > I was wrongly under the impression, that serializable-lambda are supposed > to work out of the box, when sending them over channels, without needing to > do any further work ("are serialized automatically" instead of "can be >

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

2019-10-01 Thread Philip McGrath
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-custom-hash-types` and the related functions:

Re: [racket-users] syntax-parse and iterecursion

2019-09-21 Thread Philip McGrath
I'm not sure if I understand your question; do you mean something like this? #lang racket (require syntax/parse/define) (define-syntax-parser macro-list [(_) #'null] [(_ x0 x ...) #'(cons x0 (macro-list x ...))]) (macro-list 1 2 3 4 5) -Philip On Sat, Sep 21, 2019 at 4:29 PM Hendrik

Re: [racket-users] syntax-parse ellipsis question

2019-09-21 Thread Philip McGrath
Use `~@` (sine Racket 7.0): (syntax-parse #'(1 2 2 a 2 2 b 2 c) [(1 (~seq n:nat ...+ x) ...) #'((~@ n ... x) ...)]) -Philip On Sat, Sep 21, 2019 at 4:15 PM Jonathan Simpson wrote: > Given this macro that I'm experimenting with: > > (syntax-parse #'(1 2 2 a 2 2 b 2 c) [(1 (~seq n:nat ...+

Re: [racket-users] Distributing raco command without `raco`

2019-09-15 Thread Philip McGrath
In your "info.rkt", define `racket-launcher-names` and `racket-launcher-libraries`, or `gracket-launcher-names` and `gracket-launcher-libraries` for a GUI app: https://docs.racket-lang.org/raco/setup-info.html#(idx._(gentag._14._(lib._scribblings%2Fraco%2Fraco..scrbl))) Note that this is handled

Re: [racket-users] Downloadable tutorials (e.g. on github)? Tutorial example source codes samples attached to DrRacket instalation?

2019-09-10 Thread Philip McGrath
On Tue, Sep 10, 2019 at 1:31 AM Prokop Hapala wrote: > "File > Open Require Path …" ... "/usr/share/racket/pkgs/games/" > > it is strange ... on one computer (at work) it works, on other (at home) > it does not want to open that directory (the dialog is a bit too > minimalistic so I don't know

Re: [racket-users] Simple macro issues

2019-09-10 Thread Philip McGrath
`On Tue, Sep 10, 2019 at 1:19 AM Simon Haines < simon.hai...@con-amalgamate.net> wrote: > This is a rather unpleasant pitfall of the REPL. If you try to evaluate >> the expression `(if #f some-unbound-identifier 1)`, you will see that it >> evaluates to `#f` in the REPL but raises an unbound

Re: [racket-users] Simple macro issues

2019-09-09 Thread Philip McGrath
On Mon, Sep 9, 2019 at 8:17 PM Simon Haines wrote: > What wasted a lot of time for me is that, despite the macroexpander's > results, the macro works as expected in the REPL. If you paste my original > macro into DrRacket, run it, then type '(hex a)' into the REPL you get the > expected result.

Re: [racket-users] Downloadable tutorials (e.g. on github)? Tutorial example source codes samples attached to DrRacket instalation?

2019-09-09 Thread Philip McGrath
For pedagogical examples, you may like the games that go along with the "Realm of Racket" book, which are also in the main Racket distribution. For example, try "Open Require Path …" for `realm/chapter2/source`, or here is the whole collection on GitHub: https://github.com/racket/realm On Mon,

Re: [racket-users] Simple macro issues

2019-09-09 Thread Philip McGrath
On Mon, Sep 9, 2019 at 2:42 AM Simon Haines wrote: > I'm still trying to figure out why my original, terrible macro behaved the > way it did, but I suspect I'll never know. I would have wasted a lot of > time on that awful construct. I appreciate your help, many thanks. > A great way to

Re: [racket-users] [racket users] make-keyword-procedure follow-up

2019-08-30 Thread Philip McGrath
Hi Kevin, This is interesting! A number of people have wanted conveniences around `keyword-apply` and accepting the same keywords as some other function. (The trouble is, different people have different ideas of what those conveniences should be.) To start with, I had a few small suggestions

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

2019-08-23 Thread Philip McGrath
If they do what you want, `curry` and `curryr` support keyword arguments (as of Racket 7.1) and handle lots of cases. If you do need to use `make-keyword-procedure`, you may want to combine it with `procedure-reduce-keyword-arity-mask`. -Philip On Fri, Aug 23, 2019 at 10:03 PM David Storrs

Re: [racket-users] Re: Is it possible to sell commercial use rights to an open source Racket package?

2019-08-23 Thread Philip McGrath
One issue you would encounter is that deciding what is a "commercial" use can be difficult. This comes up with Creative Commons licenses ( https://creativecommons.org/faq/#does-my-use-violate-the-noncommercial-clause-of-the-licenses ): > … there will always be uses that are challenging to

Re: [racket-users] Re: [standard-fish] Summer competiton 2019

2019-08-17 Thread Philip McGrath
This contest is a bright idea, so here's a standard lightbulb: [image: default-lightbulb.png] The code is at https://gist.github.com/LiberalArtist/4d0059f5af23043515a3cc74bd4928c2 -Philip On Wed, Aug 14, 2019 at 10:05 PM Stephen De Gabrielle < spdegabrie...@gmail.com> wrote: > Amazing face!

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread Philip McGrath
The relevant chapter of the reference is "Concurrency and Parallelism" ( https://docs.racket-lang.org/reference/threads.html): > All constant-time procedures and operations provided by Racket are > thread-safe because they are atomic. For example, set! >

Re: [racket-users] Why custom-display of printable<%> interface is called twice?

2019-07-28 Thread Philip McGrath
Someone had a very similar question about `printable<%>`, including both the confusion about multiple calls and the bug of failing to use the `out` port, on Stack Overflow recently: https://stackoverflow.com/questions/55975708/racket-equivalents-of-pythons-repr-and-str/56759937#56759937 Since

Re: [racket-users] Message in the meantime?

2019-07-24 Thread Philip McGrath
On Wed, Jul 24, 2019 at 4:16 PM Matthew Butterick wrote: > Support for alternative notation in the documentation system is a missing > piece in Racket's LOP tooling: > > … primary forms like `defproc` assume that the language uses > S-expressions. > > Examples: `#lang datalog` [1] and `#lang

Re: [racket-users] Building "#lang dungeon"

2019-07-24 Thread Philip McGrath
I wonder if the unit system, or something like it, could be a basis for implementing this, especially the aspect of avoiding too much explicit argument passing. Signatures can define bundles of identifiers, like file IO primitives. This lets you avoid having to know which specific primitives are

Re: [racket-users] Re: Racket2 possibilities

2019-07-23 Thread Philip McGrath
I thought one of the most compelling parts of Matthew's proposal was at around 37:41 in the video , when he said, I've seen students in my class genuinely struggle with just the syntax. I think it would be very useful to hear more (from Matthew

Re: [racket-users] Specializing functions accepting keywords

2019-07-11 Thread Philip McGrath
The easiest way I know is to use `curry`, since Alexis fixed its keyword argument support last year: #lang racket (define (fish #:name[name #f] #:color [color #f] #:studio

Re: [racket-users] Language-Specific Plugins: Toolbar button functionality to call drracket:eval:expand-program

2019-07-01 Thread Philip McGrath
On Mon, Jul 1, 2019 at 11:40 AM Thomas Dickerson < thomas_dicker...@alumni.brown.edu> wrote: > On Fri, Jun 28, 2019 at 5:50 PM Philip McGrath > wrote: > >> Again, this part works just fine. In particular, because of the way Racket's >> submodules >> <https:/

Re: [racket-users] Language-Specific Plugins: Toolbar button functionality to call drracket:eval:expand-program

2019-06-28 Thread Philip McGrath
If you're sure you want to get the raw program source and deal with it manually, you can use the method `get-definitions-text ` on the DrRacket

Re: [racket-users] Language-Specific Plugins: Toolbar button functionality to call drracket:eval:expand-program

2019-06-25 Thread Philip McGrath
The functionality you describe—in particular, setting up clean evaluation contexts—sounds a lot like what the "Run" button already does. Unless you have some other notion of "running" in mind for programs in your DSL, I think what you describe could be accomplished nicely with a "main" submodule,

Re: [racket-users] how to uninstall Racket 5.3.6?

2019-06-21 Thread Philip McGrath
One possibility is that you might have installed Racket via apt. A command like: sudo apt list --installed | grep racket should help to see if that is the case. If so, I think uninstalling the apt package would be sufficient. -Philip On Fri, Jun 21, 2019 at 3:23 PM Norman Ramsey wrote: > I

Re: [racket-users] Re: Git-Backed Racket Packages, git archive

2019-06-13 Thread Philip McGrath
According to §2.2 Package Sources , for a Git package source in the syntax ‹scheme›://‹host›/.../‹repo›[.git][/][?path=‹path›][#‹rev›], "the package’s checksum is the hash identifying ‹rev› if ‹rev› is a branch or

Re: [racket-users] What is the difference between foo/c and foo? when creating contracts?

2019-06-05 Thread Philip McGrath
To add a bit to what Alexis said about flat contracts: On Wed, May 22, 2019 at 1:23 PM Alexis King wrote: > Your intuition is right, but let me make it more precise: foo? is used > when something is a flat contract, and foo/c is used otherwise. Flat > contracts only check *first order

Re: [racket-users] Typed Racket segmentation fault

2019-06-05 Thread Philip McGrath
On Wed, Jun 5, 2019 at 12:26 PM James Geddes wrote: > Annoyingly, my colleague had got the same speedup by using Numpy, but that > does require a change to the way one arranges the calculation (and the > change is unnatural, to my eye). > Also, that's cheating! Numpy is mostly written in C,

Re: [racket-users] Typed Racket segmentation fault

2019-06-05 Thread Philip McGrath
ar`, then the program also works correctly. > > The program also works correctly with the JIT off, and under RacketCS. > > https://gist.github.com/samth/683042c4754c1c5ce284794b19dd37e3 > > > > On Wed, Jun 5, 2019 at 11:02 AM 'Paulo Matos' via Racket Users > > wrote:

Re: [racket-users] Typed Racket segmentation fault

2019-06-05 Thread Philip McGrath
What version of Racket are you using? I get a segfault in 7.2, but 7.3 works for me. -Philip On Wed, Jun 5, 2019 at 10:42 AM James Geddes wrote: > Dear All, > > The following Typed Racket program is intended to produce an image of the > Mandelbrot set (but it doesn't bother actually displaying

  1   2   3   4   >