Re: [racket] Cannot share a require/typed #:struct

2015-02-05 Thread Alexis King
Why not create an intermediary module? Create a typed module, call it typed/data-defn, and use require/typed/provide to import the struct and provide it. Then just require that module for all other modules that need to use that struct in a typed context. > On Feb 5, 2015, at 21:10, Benjamin Gre

Re: [racket] weird behavior with in-range in typed racket

2015-02-05 Thread Alexis King
This is because Racket’s for loops special-case on in-range, in-list, in-vector, etc. They do this for performance reasons—no need to check the type at runtime. This is probably redundant in a typed context, anyway, though, since the typechecker should be able to (ideally) make those optimizatio

[racket] Is the pkg-build service down?

2015-02-06 Thread Alexis King
Packages don’t appear to have been building on pkg-build for the past two days. Any reason for that? Racket Users list: http://lists.racket-lang.org/users

[racket] What is the purpose of val-first-projection in contract combinators?

2015-02-07 Thread Alexis King
The documentation for make-contract and similar functions includes an optional #:val-first-projection keyword argument. What is this for

Re: [racket] ARGH my packages are broken and I'm stuck

2015-02-10 Thread Alexis King
What do you get running raco pkg show? (Run raco pkg show -l if you’re using a dev build.) That should tell you what packages Racket thinks you have installed. > On Feb 10, 2015, at 18:38, Matthew Flatt wrote: > > At Tue, 10 Feb 2015 18:19:40 -0800, Ryan Davis wrote: >> 10045 % raco pkg instal

Re: [racket] number->string in the HtDP student languages

2015-02-18 Thread Alexis King
This is interesting behavior. To explain why it happens, this has something to do with how the HtDP languages handle exact/inexact numbers. For example, in plain Racket, (exact? 0.75) is #f, but in BSL, it is #true. In BSL, numbers are exact unless otherwise specified. Note that explicitly using

Re: [racket-users] Racket2 and syntax

2019-07-14 Thread Alexis King
Well! While I am sure that everyone at RacketCon has already discussed this to death, and I’m sure there has been plenty of support to counterbalance the tomato-throwing, let me be the first to say something positive on the mailing list so the optics from here aren’t so gloomy: I find this idea

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

2019-07-16 Thread Alexis King
> On Jul 16, 2019, at 15:32, rocketnia wrote: > > I find it worrying that racket2 would be kicked off with infix syntax > (something which I think of as an unnecessary sticking point in the way of > prospective macro writers and language designers, and hence a move *toward* > elitism *as oppos

Re: [racket-users] Racket2 possibilities

2019-07-21 Thread Alexis King
> On Jul 21, 2019, at 00:19, Matthew Flatt wrote: > > I have in mind "Honu: Syntactic Extension for Algebraic Notation through > Enforestation", GPCE 2012. It shows how we can bridge the relatively linear > structure of non-() programs to the tree structure of S-expressions. > Specifically, th

Re: [racket-users] Racket2 possibilities

2019-07-22 Thread Alexis King
> On Jul 22, 2019, at 14:16, Dexter Lagan wrote: > > A parens-less Racket2 would become Crystal. No it won’t. I am quite confident that Racket with any syntax will not be like any other language that currently exists. What other language has Racket’s advanced, robust compile-time metaprogramm

Re: [racket-users] Re: on-boarding new racketeers

2019-08-13 Thread Alexis King
Oh, come on. “Adding labels to repositories” and “adding issue templates” isn’t “increasing lock-in.” There’s no slippery slope here. I think the time and energy Stephen has dedicated to the community should be thanked and appreciated, not discouraged. I’m frustrated by the number of words you s

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

2019-08-23 Thread Alexis King
Disclaimer: I am not a lawyer. (But, as others have mentioned, the answer is yes.) In the subject of your subject, you mention “an open source Racket package,” but in the body of your email, you talk about “an open source Racket project.” If you are genuinely talking about a Racket package (in

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

2019-08-23 Thread Alexis King
> On Aug 23, 2019, at 13:03, Matthew Butterick wrote: > > In some cases, SFC takes ownership of trademarks and copyrights [1] which > means that in terms of license interpretation & enforcement, assumedly the > buck would now stop with them. AFAIK, copyright of the Racket codebase is not the

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

2019-08-23 Thread Alexis King
> On Aug 23, 2019, at 14:19, Matthew Butterick wrote: > > You're omitting some key facts. Maybe so, but that is, in fact, why I sent the email. I was hoping you could clue me in as to what I was missing. (Maybe it’s unfair of me to ask you for free legal analysis, but I don’t feel like it’s al

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

2019-08-23 Thread Alexis King
[1] > > [1] https://sfconservancy.org/blog/2014/jun/09/do-not-need-cla/ > <https://sfconservancy.org/blog/2014/jun/09/do-not-need-cla/> > > >> On 23 Aug 19, at 12:29 PM, Alexis King > <mailto:lexi.lam...@gmail.com>> wrote: >> >> Maybe so, but tha

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

2019-08-28 Thread Alexis King
> On Aug 28, 2019, at 11:54, Neil Van Dyke wrote: > > If someone violates (their non-lawyer interpretation of) the Racket license, > in a conspicuous manner like you suggest, would they not expect the SFC to > send them a nastygram -- perhaps if only for the SFC to show that they defend > the

Re: [racket-users] read-eval-print-loop, #%top-interaction, and define

2019-09-24 Thread Alexis King
> On Sep 24, 2019, at 23:01, Jesse Alama wrote: > > The question is: we do we get the error with define if we know that step is > undefined? Shouldn't we learn, first, that step is undefined? The top level is hopeless. Unlike in a module, an unbound identifier at the top level is not a syntax

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

2019-10-10 Thread Alexis King
tl;dr: You need to use an ellipsis, so your pattern should be ((~between x:integer 3 3) ...). A (much) more detailed explanation of why follows. ~between is an ellipsis-head pattern. The most common ellipsis-head pattern, ~optional, also works as a plain head pattern, but ~between does not. What

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

2019-10-12 Thread Alexis King
n't. > > Once again, thanks for taking the time to explain this! > > -- Jonathan > > On Thursday, October 10, 2019 at 11:17:53 PM UTC-4, Alexis King wrote: > tl;dr: You need to use an ellipsis, so your pattern should be ((~between > x:integer 3 3) ...). A (much) more

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

2019-10-13 Thread Alexis King
The syntax error I'm > getting here isn't particularly enlightening. > > Once again, I really appreciate any help here. > > -- Jonathan > > On Saturday, October 12, 2019 at 2:28:05 PM UTC-4, Alexis King wrote: > I believe your two syntax classes are identical, except

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

2019-10-25 Thread Alexis King
Unlike eq? on symbols, eq?’s behavior on quoted lists is unspecified, so I do not think there is a significantly deeper reason than “that isn’t what the current implementation chooses to do.” Whether the answer is #t or #f could change tomorrow, on a different VM, on a different architecture, or

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

2019-10-25 Thread Alexis King
> On Oct 25, 2019, at 11:34, David Thrane Christiansen > wrote: > > I'm not sure why Guile returns #t for this. If pairs are mutable there, then > it could lead to aliasing problems. The Scheme standard has historically left the behavior of mutation on quoted values unspecified to permit prec

Re: [racket-users] Does match against list traverse the whole list?

2019-10-29 Thread Alexis King
> On Oct 29, 2019, at 12:41, Christopher Lemmer Webber > wrote: > > But the documentation says that the `list?` predicate is O(n). I’m not sure where you’re seeing that, but the documentation actually says just the opposite. Specifically, it says this: > This procedure effectively takes const

Re: [racket-users] Need a scribble identity wrapper. A no-op.

2019-11-03 Thread Alexis King
Use the search box in the documentation: https://docs.racket-lang.org/search/index.html?q=elem > On Nov 3, 2019, at 18:34, Hendrik Boom wrote: > > On Sun, Nov 03, 2019 at 02:46:42PM -0800, William J. Bowman wrote: >> I think ‘elem’ will d

Re: [racket-users] Typed Racket needs annotation to realize (Mutable-HashTable Symbol Symbol) is of a more general type

2019-11-06 Thread Alexis King
The point Sam is making is about the variance of Mutable-HashTable specifically. Its relationship to the HashTable supertype is a red herring (which is why changing the type to Mutable-HashTable didn’t help). Immutable data structures, like lists and immutable hash tables, are covariant in thei

[racket-users] Modeling a context-sensitive evaluation context with PLT Redex?

2019-11-09 Thread Alexis King
Hello, I am trying to model a (not quite algebraic) effect system in PLT Redex, but I’m struggling to encode my evaluation contexts into Redex’s pattern language. My question is best explained via example, so I’ll start with a bog-standard call-by-value lambda calculus: (define-language la

Re: [racket-users] Modeling a context-sensitive evaluation context with PLT Redex?

2019-11-09 Thread Alexis King
t/redex/tree/master/redex-examples/redex/examples/delim-cont > 3. http://www.ccs.neu.edu/home/stchang/pubs/Chang-Felleisen-ESOP2012.pdf > > -- > Jay McCarthy > Associate Professor @ CS @ UMass Lowell > http://jeapostrophe.github.io > Vincit qui se vincit. > > > -- >

Re: [racket-users] Modeling a context-sensitive evaluation context with PLT Redex?

2019-11-09 Thread Alexis King
> On Nov 9, 2019, at 09:18, Jay McCarthy wrote: > > "remember that an evaluation context is just a way of describing more > succinctly what you could otherwise define by hand as a big, > complicated relation on individual terms." Yes, that makes sense — I wasn’t really considering what it would

[racket-users] Custom scribble renderers and xref information

2019-11-17 Thread Alexis King
I’ve been playing on and off with writing a custom scribble renderer for a blog, and my experiments have mostly been fine, but I am very confused about xref information. I want to use a URL fragment format for my blog that is different from the one used by the Racket documentation, but I would a

Re: [racket-users] Custom scribble renderers and xref information

2019-11-17 Thread Alexis King
Thanks for the prompt reply! > On Nov 17, 2019, at 11:15, Matthew Flatt wrote: > > Making mutual references work is the job of info-in and info-out files. > Document A's info-out file is the info-in file for any document that > needs to reference document A. Yes, you have to run to a fixed point

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

2019-11-21 Thread Alexis King
> On Nov 21, 2019, at 11:21, James Platt wrote: > > If we can direct more of the energy of this community into, not just > improving the documentation, but the way we do documentation, it would be a > major improvement. Requiring lots of parentheses doesn't bother me. Lack of > infix notatio

[racket-users] fcontrol and dynamic-wind

2019-11-30 Thread Alexis King
Hello, I have been playing with implementing algebraic effects using delimited control, and Dorai Sitaram’s `fcontrol` and `%` operators are a natural fit. For example, it’s straightforward to implement McCarthy’s `amb` operator using them: (define amb-tag (make-continuation-prompt-tag 'amb)

Re: [racket-users] fcontrol and dynamic-wind

2019-11-30 Thread Alexis King
> On Nov 30, 2019, at 09:23, Matthew Flatt wrote: > > There's not a safe way. In many cases, Racket lets you write new things > that have the power of built-in through unsafe APIs --- and it turns > out that there are unadvertised procedures (provided by the primitive > `#%unsafe` module) for thi

Re: [racket-users] fcontrol and dynamic-wind

2019-11-30 Thread Alexis King
> On Nov 30, 2019, at 20:52, Matthew Flatt wrote: > > They are, as long as any invoked `dynamic-wind` thunks are safe in > atomic mode. (After all, `unsafe-abort-current-continuation/no-wind` > and `unsafe-call-with-composable-continuation/no-wind` were created to > support `unsafe/try-atomic`.)

Re: [racket-users] Breaking semaphores

2020-01-18 Thread Alexis King
Killing a thread is different from breaking a thread. Killing a thread kills the thread unrecoverably, and no cleanup actions are run. This usually isn’t what you want, but there’s always a tension between these kinds of things: defensive programmers ask “How do I make myself unkillable so I can

Re: [racket-users] Breaking semaphores

2020-01-18 Thread Alexis King
eaks?". What's the actual use case for calling semaphore-wait (and not > semaphore-wait/enable-break) while breaks are enabled? > > On Sat, Jan 18, 2020 at 12:47 AM Alexis King <mailto:lexi.lam...@gmail.com>> wrote: > Killing a thread is different from breaking a thr

Re: [racket-users] Breaking semaphores

2020-01-18 Thread Alexis King
gt; certainly wrong. If car and cdr can check their arguments by default, > shouldn't semaphores guard against misuse too? > > On Sat, Jan 18, 2020 at 1:04 AM Alexis King <mailto:lexi.lam...@gmail.com>> wrote: > It is guaranteed to leave the semaphore in a consisten

Re: [racket-users] Breaking semaphores

2020-01-18 Thread Alexis King
mebody else can or somebody can confirm that it's not a good > API precedent. I'm trying to build some concurrency libraries > <https://github.com/jackfirth/rebellion/issues/397> and I'd like to be sure > there isn't some important use case I'm missing.

Re: [racket-users] Breaking semaphores

2020-01-18 Thread Alexis King
indifferent to whether breaking is enabled? > > On Sat, Jan 18, 2020 at 1:28 AM Alexis King <mailto:lexi.lam...@gmail.com>> wrote: > Actually, I change my mind, I can trivially think of a case where it’s fine: > if you’re just using a semaphore as an event. One thread waits

Re: [racket-users] Breaking semaphores

2020-01-18 Thread Alexis King
hore would either enable breaks, or check that breaks or > disabled, or neither of those? > > On Sat, Jan 18, 2020 at 1:45 AM Alexis King <mailto:lexi.lam...@gmail.com>> wrote: > No, I don’t think so, and here’s why: imagine a library provides an > abstraction that intern

Re: [racket-users] Breaking semaphores

2020-01-18 Thread Alexis King
ions.html> > On Jan 18, 2020, at 04:27, Alexis King wrote: > > I don’t personally have any problems with Racket’s semaphore interface as it > exists today. I think having the choice of whether or not to enable breaks > mostly makes sense as something the ambient environment control

Re: [racket-users] Breaking semaphores

2020-01-18 Thread Alexis King
my day job involves working on > concurrency frameworks. Specific use cases are more what I'm after. For > instance, what would you like to use mutexes for? > >> On Sat, Jan 18, 2020 at 2:34 AM Alexis King wrote: >> Oh, an addendum: I would be remiss not to mention the

Re: [racket-users] Breaking semaphores

2020-01-18 Thread Alexis King
Oh: something more ambitious that I would enjoy having would be an implementation of IVars and LVars to avoid needing to think about locking entirely. > On Jan 18, 2020, at 05:00, Alexis King wrote: > >  > I would use mutexes in relatively standard ways, I think, to prot

Re: [racket-users] Megaparsack and where errors happen

2020-02-21 Thread Alexis King
Hi Matt, I think you probably want to read this section of the docs: https://docs.racket-lang.org/megaparsack/parsing-branching.html#%28part._.Backtracking_with_caution%29 The core idea is that `try/p` is a heavy hammer. It causes any failure inside its scope to backtrack, so you might end up a

Re: [racket-users] how to adapt BC code for Racket CS?

2020-02-22 Thread Alexis King
I have a related but distinct question about the blog post: I’m curious what guarantees I can come to expect from the Racket CS optimizer. The post includes the following example: (for/fold ([v #f]) ([i (in-range N)]) i) On both Racket BC and Racket CS, I’d expect the optimizer to turn this

Re: [racket-users] how to adapt BC code for Racket CS?

2020-02-23 Thread Alexis King
> On Feb 23, 2020, at 18:28, Matthew Flatt wrote: > > None of Racket BC, Racket CS, or Chez Scheme by itself will optimize > away the unused loop argument. That kind of interprocedural dead-code > elimination is out of reach for the current compilers, except to the > degree that inlining turns th

Re: [racket-users] Starting racket with at-exp

2020-03-02 Thread Alexis King
The -l option loads a module path. As `racket --help` documents, `-l ` is equivalent to `-e '(require (lib ""))'`. Since (require (lib "at-exp racket")) won’t help you much, neither will `-l 'at-exp racket'`. I’m not totally sure why you thought `-l` was the right option here, but it doesn’t set

Re: [racket-users] questions about top-level-bind-scope in root-expand-context

2020-03-23 Thread Alexis King
> On Mar 23, 2020, at 13:46, George Neuner wrote: > > I've run into this problem before ... I don't recall the official > explanation, but my takeaway was that Racket does not permit you to > directly *export* a value - you have to export a function or macro > that produces the value. > > E.g.,

Re: [racket-users] How to find source file loaded by/relevant for (require )?

2020-03-27 Thread Alexis King
I recommend Ryan Culpepper’s whereis package: https://docs.racket-lang.org/whereis/index.html It provides both a programmatic interface and a raco command. Alexis > On Mar 27, 2020, at 03:56, Marc Kaufmann wrote: > > Hi, > > I am trying to s

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

2020-04-23 Thread Alexis King
> On Apr 23, 2020, at 21:15, Hendrik Boom wrote: > > (fprintf anomaly "resEEEulttyope was ~s~n" resulttype) > (fprintf anomaly "set resulttyoe to ~s~n" ty) > `(set! resulttype ty) > (fprintf anomaly "resEEulttyope now ~s~n" resulttype) (Re-sending this because I f

Re: [racket-users] rackunit and logging

2020-05-23 Thread Alexis King
> On May 22, 2020, at 18:47, Shriram Krishnamurthi wrote: > > As an aside, I'm not entirely sure what `test-log!` is there for. Presumably > it's to record in the log "tests" run by operations that are not part of > rackunit? I'm curious how people have used it. Other people have answered othe

Re: [racket-users] rackunit and logging

2020-05-23 Thread Alexis King
> On May 23, 2020, at 08:53, Shriram Krishnamurthi wrote: > > Alex, thanks for that information. I'm going to go investigate that next. Related to that, I just remembered the existence of rackunit/text-ui and rackunit/gui, which implement two different reporters for RackUnit test cases/suites.

Re: [racket-users] Hunting a possible fsemaphore-post/wait bug

2020-05-24 Thread Alexis King
> On May 24, 2020, at 02:10, Dominik Pantůček > wrote: > > At first I was surprised that you are basically suggesting using > spinlocks (busy-wait loops) instead of futex-backed (at least on Linux) > fsemaphores. That is a waste of CPU time. Performing CAS operations in a loop isn’t really dire

Re: [racket-users] Hunting a possible fsemaphore-post/wait bug

2020-05-24 Thread Alexis King
I realized a little while after writing my previous message that I was probably misinterpreting you. I was envisioning you using box-cas! on a box containing a functional queue, so there would be no need to synchronize. You’d just pull the queue out of the box, functionally update it, and use bo

Re: [racket-users] Testing for Packages

2020-05-26 Thread Alexis King
> On May 26, 2020, at 21:36, Robert Postill wrote: > > One thing that troubled me was that the tests seemed to be dependant on the > package already being installed. I think this is very common within the Racket ecosystem. I would guess that very few packages are consciously designed to be “re

Re: [racket-users] How to change package name on the package index?

2020-06-04 Thread Alexis King
> On Jun 4, 2020, at 21:23, Siddhartha Kasivajhula wrote: > > I'd prefer to avoid that since (1) it would lose the package metadata and (2) > it could be off the package index for up to a day (the package index refresh > cycle) during which time other packages depending on it would be broken T

Re: [racket-users] identifier used out of context

2020-06-07 Thread Alexis King
> On Jun 7, 2020, at 17:44, Sorawee Porncharoenwase > wrote: > > Wow, so block is currently buggy?! > This issue isn’t with `block`, per se (though `block` could cooperate more nicely with definition context expansion to avoid this problem). You can reproduce it without any first-class defin

Re: [racket-users] Why does this counter behave differently in different runtimes?

2020-06-17 Thread Alexis King
This is quite curious. It appears to be a compiler bug. Here’s a very slightly smaller test case: #lang racket/base (define count! (let ([i 0]) (λ () (begin0 (set! i (add1 i)) (+ i) (count!) The fully-expanded program looks fine, so i

Re: [racket-users] ask the type of a value

2020-08-03 Thread Alexis King
In general, the answer is “no,” mostly because it’s not clear in Racket what “the type of a value” means. It’s difficult to come up with a definition that would be useful enough to satisfy your criterion of not “having to guess it first.” Consider: suppose you had a hypothetical `type-of` operat

Re: [racket-users] ask the type of a value (partial solution)

2020-08-03 Thread Alexis King
> On Aug 3, 2020, at 11:48, Hendrik Boom wrote: > > Still, it would be nice to find out how to get this information more > directly instead of relying on functions that do much more than > what I was asking for. In general, there aren’t any. The ability of struct->vector to extract a symbolic

<    1   2   3   4