[racket-users] [ANN] megaparsack 1.4 — support for user-defined parser state

2021-07-04 Thread Alexis King
Hi all, As some of you may know, I am the maintainer of the Megaparsack package, a Parsec-style parser combinator library. Though it’s mostly been in maintenance mode for some time, the latest release adds a significant new feature: *user-defin

[racket-users] Re: [ANN] megaparsack 1.4 — support for user-defined parser state

2021-07-04 Thread Alexis King
Addendum: the docs are now built, so you can read more at these two links: - https://docs.racket-lang.org/megaparsack/state.html - https://docs.racket-lang.org/megaparsack/reference.html#%28part._parser-parameters%29 On Sun, Jul 4, 2021 at 2:21 AM Alexis King wrote: > Hi all, >

[racket-users] Can I get the behavior of `overment` followed by `augride` with a single class?

2021-07-16 Thread Alexis King
Hello, While doing some OOP in Racket today, I found myself in a situation that would benefit from two seemingly contradictory things: 1. I want to be able to override a superclass method, and I want to be certain that I get to handle the method before any of my subclasses do. This s

Re: [racket-users] Can I get the behavior of `overment` followed by `augride` with a single class?

2021-07-25 Thread Alexis King
On Mon, Jul 19, 2021 at 11:08 AM Matthew Flatt wrote: > Are there other useful variants that are not currently supported (at least > directly)? > I think the answer to this is “no.” My reasoning follows. >From the perspective of subclasses, superclass methods come in three sorts: overridable, a

[racket-users] The history of hygiene for definition contexts

2021-07-28 Thread Alexis King
Hi all, I recently posted two tricky hygiene puzzles on Twitter , reproduced below for completeness: (let ([x 'outer]) (define-syntax-rule (m a) (let ([a 'inner]) x)) (m x)) (let ([x 'outer]) (define-sy

Re: [racket-users] Re: The history of hygiene for definition contexts

2021-07-29 Thread Alexis King
On Thu, Jul 29, 2021 at 12:53 PM Michael Ballantyne < michael.ballant...@gmail.com> wrote: > The second example you give becomes more natural if you've considered > simpler cases of macros in definition contexts first > I agree that breaking the macro into two parts—one of which inserts a binder

[racket-users] Combining contract checking with normalization?

2022-03-06 Thread Alexis King
Hello, As a user of the Racket contract system, I sometimes find myself thinking about the potential utility of “coercing” or “canonicalizing” contracts. In Racket programs, we often idiomatically allow values to be provided to a function in a non-canonical form for the sake of convenience. One ex

Re: [racket] Inconsistency of `in-range` and numerical issues

2015-02-26 Thread Alexis King
I think that’s precisely what Alexander’s exact-decimal-lang does. It’s a meta-language just like at-exp. > On Feb 26, 2015, at 08:38, Eric Dong wrote: > > I feel like swapping out flonums by default to rationals by default would > cause unexpected slowness in a large number of programs though

Re: [racket] TLS "atom?" definition for Scheme does not work in DrRacket

2015-03-03 Thread Alexis King
> That's how I found the problem, although I had to chase it down off the > bottom of the pane. If the arrow goes off-screen, you can right-click the identifier and select “Jump to Binding Occurrence” to automatically scroll to where the identifier is bound. You can also select “Tack/Untack Arro

[racket] Is this function typeable in Typed Racket?

2015-03-04 Thread Alexis King
Disclaimer: this question is both a real question and me trying to push the type system to its limits, so I’m not really expecting to get a satisfactory answer. I posted a question on Stack Overflow here , but I’m guessing that this is unfortunately

Re: [racket] Problem with response/output

2015-03-06 Thread Alexis King
I do sort of agree that the void? requirement is strange and unneeded. It’s usually only used to indicate that a function provided by some module returns #, but callback functions are usually specified with any as the return value to allow precisely this sort of thing. > On Mar 6, 2015, at 16:2

Re: [racket] Looking for better designs to learn principles.

2015-03-14 Thread Alexis King
There’s also the thrush function from the point-free package, which uses the argument order of the threading macro while providing the functional style of compose. http://pkg-build.racket-lang.org/doc/point-free/index.html?q=thrush#%28def._%28%28lib._point-free%2Fmain..rkt%29._thrush%29%29

[racket] Nearly all of the functionality from the 2htdp teachpacks is now available in 2htdp-typed

2015-03-14 Thread Alexis King
I’ve had the 2htdp-typed package available for a little while now, which is a Typed Racket wrapper for the HtDP/2e teachpacks. It was missing big-bang, since it is implemented as a macro, but I have now added support for big-bang in Typed Rack

Re: [racket] Nearly all of the functionality from the 2htdp teachpacks is now available in 2htdp-typed

2015-03-15 Thread Alexis King
pper works, which my > first and second implementation of the current world package did not.] -- > Matthias > > > > > > On Mar 14, 2015, at 8:39 PM, Alexis King wrote: > >> I’ve had the 2htdp-typed package >> <https://github.com/lexi-lambda/racket-2htd

[racket] Can I get some feedback / a code review for some simple game code?

2015-03-16 Thread Alexis King
I wrote a “game” (in quotes because it’s a WIP and barely qualifies as a game in its current state) using Typed Racket and big-bang. You can find it here: https://github.com/lexi-lambda/racket-pipe-game-clone I’ve been wanting to try my ha

[racket] Submodule tests vs separate-file tests

2015-03-17 Thread Alexis King
Is there any preferred convention for location of tests in libraries? Using a test submodule is convenient, but does keeping all the tests in separate files reduce loading costs? Does using submodules bloat the .zo size, or are they compiled separately a la Java inner classes? Alexis___

Re: [racket] Submodule tests vs separate-file tests

2015-03-17 Thread Alexis King
file. > > At Tue, 17 Mar 2015 01:38:25 -0700, Alexis King wrote: >> Is there any preferred convention for location of tests in libraries? Using >> a >> test submodule is convenient, but does keeping all the tests in separate >> files >> reduce loading costs? D

Re: [racket] Can I get some feedback / a code review for some simple game code?

2015-03-17 Thread Alexis King
un, and the code was easy to read. >> Besides that I don't have much constructive criticism. Figure out why it's >> lagging and finish the game! >> >> >> On Mon, Mar 16, 2015 at 4:01 AM, Alexis King wrote: >> I wrote a “game” (in quotes because it’s a WIP

Re: [racket] the typed Values restriction

2015-03-18 Thread Alexis King
It might be a good idea to have a special case for Values when producing error messages. Currently, even though the documentation mentions that Values is only valid as the return type of a function, the error messages can be a little confusing. For example, using Values as an expression produces

Re: [racket] Can I get some feedback / a code review for some simple game code?

2015-03-18 Thread Alexis King
ta_structure) > > > On Mar 17, 2015, at 1:14 PM, Alexis King wrote: > >> That’s probably a good idea. I’m not quite sure what you’re referring to by >> “zippers”, though—could you elaborate? >> >>> On Mar 17, 2015, at 06:44, Matthias Felleisen wrote: &g

[racket] Serving static content

2015-03-20 Thread Alexis King
I’m interested in creating a web application, and I plan to write the front-end in ordinary JavaScript and HTML. A large portion of the content served will just be static HTML, JavaScript, and CSS. I plan to interact with the server via a standard JSON API and WebSockets, both of which I’m inte

Re: [racket] Unsafe version of require/typed?

2015-03-20 Thread Alexis King
This has been discussed before, and I think it’s a good idea, but I also think any such feature should be well-hidden. I’m sure that new users would use it frequently just to make the typechecker “shut up” when really their programs are unsound. > On Mar 20, 2015, at 12:30, Hendrik Boom wrote:

Re: [racket] Unsafe version of require/typed?

2015-03-20 Thread Alexis King
o their work. > > In this particular case, they can always opt out of tr entirely, lets > not forget. > > Robby > > On Fri, Mar 20, 2015 at 3:41 PM, Alexis King wrote: >> This has been discussed before, and I think it’s a good idea, but I also >> think any such fea

Re: [racket] making libraries work natively with both Racket & Typed Racket

2015-03-21 Thread Alexis King
Sorry for my misunderstanding, but what’s the point of this? Why not just require the typed code in untyped code directly (as you’re doing in 'violator)? As far as I can tell, it looks like you’re just manually rewriting the generated contracts, so I’m not really sure what this achieves. > On M

[racket] Intercepting WebSocket connections to the Racket web server?

2015-03-21 Thread Alexis King
The WebSocket handshake is intentionally implemented in such a way so that WebSocket connections can be performed using the same port that the HTTP server is running on. This is implemented by making the handshake a standard HTTP 1.1 GET request with an “Upgrade: websocket” header. I’m interest

Re: [racket] TR: mystery behavior with optional-argument types

2015-03-21 Thread Alexis King
This feels eerily familiar to a very similar bug I found just yesterday, which I’ve reported here: https://github.com/racket/typed-racket/issues/56 Something about this is definitely very broken. For the first function, f1, it “typechecks” even

Re: [racket-users] carmack s-expression tweet

2015-03-27 Thread Alexis King
It might be interesting to create a binary s-expression format for more efficient reading/writing, a la BSON’s relationship to JSON. Perhaps even with some sort of optional compression. Racket’s reader is fairly complicated, though, so it might need to restrict itself to a useful subset? > On M

Re: [racket-users] carmack s-expression tweet

2015-03-27 Thread Alexis King
kind of matching either way, and prefab > structs can be matched > > (match command > [(list 'move x y) ... > > becomes > > (match command > [(move x y) ... > > On Fri, Mar 27, 2015 at 7:15 PM, Alexis King > wrote: > It might be interesting to create

Re: [racket-users] carmack s-expression tweet

2015-03-27 Thread Alexis King
Hmm, yes, on closer inspection, I see that you’re right. It’s not worthless, but it’s definitely not ideal for actually using as a communication protocol. So I guess my original point still stands: having a consistent binary encoding for s-expressions could be nice. > On Mar 27, 2015, at 18:10,

[racket-users] Re: [racket] Intercepting WebSocket connections to the Racket web server?

2015-03-28 Thread Alexis King
e a complete request, > then you'd need to customize the dispatching server directly with a > new kind of read-request and request structure that can stop in the > middle. I think what I'd do is make a super-struct and re-use > everything from the HTTP server when the handshak

Re: [racket-users] abort test but not test suite?

2015-03-30 Thread Alexis King
The check-equal? function and friends don't do anything special to delimit control, so failing a check will abort the whole program if it isn't contained within a test case. You can use the test-case or test-begin forms to limit the extent of fail-check (which just raises an exn:test:check excep

Re: [racket-users] the Racket manifesto

2015-04-09 Thread Alexis King
I think Greg Hendershott’s Fear of Macros tutorial is pretty top-notch. Would it make any sense to adapt and incorporate that into the Racket docs? > On Apr 9, 2015, at 12:28, Geoffrey Knauth wrote: > > Since from his first months learning Racke

Re: [racket-users] Struggling with macros

2015-04-13 Thread Alexis King
What exactly is the difference here between your define-opcode macro and Racket’s define-struct form? For example, simply doing (define-struct A2 result left right relop) would generate make-A2, A2? A2-result, A2-left, etc. What you describe is certainly possible, but I don’t think it’s currentl

Re: [racket-users] "Save as" Scribble file extension

2015-04-13 Thread Alexis King
I’ve done this, too. Could there be some way for #langs to report a default file extension to DrRacket? > On Apr 9, 2015, at 15:31, Prabhakar Ragde wrote: > > When I am editing a Scribble file in DrRacket and use "Save Definitions > As..." to start a new version, the system file dialog comes u

Re: [racket-users] syntax-parse and optional keywords

2015-04-19 Thread Alexis King
You can use ~and to bind it to an attribute. (syntax-parse #'(foo) [(_ (~optional (~and #:kw kw))) (attribute kw)]) ; => #f > On Apr 17, 2015, at 05:38, Konrad Hinsen wrote: > > Hi everyone, > > my question looks like something straightforward, but I have been > reading through the docume

[racket-users] What is the purpose of the undocumented #:dispatch option for define-generics?

2015-04-24 Thread Alexis King
I’m working my way through the implementation of racket/generic, and this jumped out at me as a little odd. Apparently, in the #:defaults and #:fast-defaults clauses of define-generics, there is support for an undocumented #:dispatch clause. Using it looks a like this: (define-generics fooable

[racket-users] Re: What is the purpose of the undocumented #:dispatch option for define-generics?

2015-04-24 Thread Alexis King
Actually, looking over this, it looks like #:dispatch just overrides the existing predicate rather than augmenting it in any way. This still seems pretty strange. What is the use case for this? > On Apr 24, 2015, at 00:49, Alexis King wrote: > > I’m working my way through the imple

Re: [racket-users] Another typed/racket puzzle: module+ and scope

2015-05-04 Thread Alexis King
Yes, it’s a known bug that submodules are broken within Typed Racket. I’m not entirely clear on the details, but I believe it is suspected that the reason is actually due to a bug in the macro expander, which should be fixed with Matthew Flatt’s new scope-sets model. Otherwise, I don’t think th

[racket-users] Instantiating a module in a meta-language

2015-05-11 Thread Alexis King
I’ve written a meta-language that adds function literal syntax to the reader, inspired by Clojure and Rackjure’s shorthand function literals. It uses curly braces for these literals, so #{+ 2 %} reads as (lambda (%) (+ 2 %)). This actually works great, but I also want to add a feature that the s

[racket-users] Why doesn't my readtable extension work in the REPL?

2015-05-11 Thread Alexis King
I’ve gotten my curly-fn meta-language working, and it works great within a module. However, evaluating #{+ 2} within the REPL just evaluates as a plain old vector, ignoring my readtable extension. What gives? Using @-expression syntax in the REPL

Re: [racket-users] Why doesn't my readtable extension work in the REPL?

2015-05-11 Thread Alexis King
Perfect, thanks to both of you for your help. I’ve pushed a fix based on the at-exp implementation. I actually didn’t know about afl, but I’m pleased to see that it works relatively similarly! I still like my syntax and auto-currying better, but I’m biased. ;) -- You received this message bec

[racket-users] Getting a sandboxed evaluator to work with a custom #lang's reader

2015-05-12 Thread Alexis King
Continuing my attempts to make a working meta-language, I'm now working on improving the documentation. I'd like to be able to use “interaction” from scribble/eval with a custom evaluator, but I'm having trouble getting a custom evaluator to work with my language. I've tried using (make-module-

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-17 Thread Alexis King
Yes, Scheme (and therefore Racket) has eq?, eqv?, and equal?. I understand the desire for eq? and equal?, but I’ve always been skeptical of the necessity of eqv?. Either way, Scheme left this behavior unspecified, but I believe Racket specifies it (though I could be wrong). Racket has two kinds

[racket-users] Specifying a contract for the end of a list

2015-05-18 Thread Alexis King
I've recently wanted a contract that lets me check the last element of a (potentially improper) list, ignoring the other elements. To do this in a general sense, I came up with this. (define (listof* init/c last/c) (flat-named-contract `(listof* ,(contract-name init/c) ,(contract-name last/

[racket-users] Implementing a lazy for/stream using for/fold/derived and delimited control

2015-05-19 Thread Alexis King
I'm trying to implement a for/stream loop using for/fold/derived that will return a lazy stream, as would be expected. One way to do this is by using delimited control, which is what I'm currently trying. If there's an easier way, let me know, but I'd still like to figure this out as a pedagogic

[racket-users] Re: Implementing a lazy for/stream using for/fold/derived and delimited control

2015-05-19 Thread Alexis King
default-continuation-prompt-tag)) (do (make-continuation-prompt-tag)) The first of the two calls at the end returns 45, but the second returns 0. Why does using a non-default prompt tag change the behavior if I'm installing my own prompt anyway? > On May 19, 2015, at 19:24, Alexis Kin

Re: [racket-users] Implementing a lazy for/stream using for/fold/derived and delimited control

2015-05-20 Thread Alexis King
rested in figuring out how to roll it myself using a solution similar to what I proposed for learning purposes. > On May 19, 2015, at 23:11, Konrad Hinsen wrote: > > On 20/05/2015 04:24, Alexis King wrote: > >> I'm trying to implement a for/stream loop using for/fold/deriv

Re: [racket-users] test submodules vs tests in separate file

2015-05-22 Thread Alexis King
You could always do something like (require (prefix-in contracted: (submod ".."))) to get separate bindings for the versions contracted by contract-out. > On May 22, 2015, at 11:37, Anthony Carrico wrote: > > Has this been an oversight? Do we need two "official" test submodules? > One from the

[racket-users] Generic collections in Racket

2015-05-23 Thread Alexis King
It's no secret that I've been angling to try and implement a generic collections library in Racket for a while now. After a few iterations, I think I've found a model I'm satisfied with. It's become big enough to now consider useful, so I'd like to get some feedback. If you're interested: $ rac

Re: [racket-users] Generic collections in Racket

2015-05-24 Thread Alexis King
Thanks for the detailed response! > One part I'm not sure about is `conj`. I understand sometimes > "whichever end is optimal" matters more than the order. But: Indeed, you are correct. Order does matter, and currently the only way to do that sort of thing is with `append`. > 1. What if you do

Re: [racket-users] Generic collections in Racket

2015-05-24 Thread Alexis King
Thanks for the feedback! To start out with, let me address your initial three points. With regards to the error messages and tooling, I agree completely, and I actually think this is one of the areas where Racket can blow Clojure out of the water. Contracts alone are pretty expressive, and I'd a

Re: [racket-users] Generic collections in Racket

2015-05-24 Thread Alexis King
> Depending on other design decisions, it make make sense to consider > this an IDE issue. That is, maybe the best thing is to have some kind > of interactive value in the REPL that lets the user have control over > the effects. (And this doesn't just have to be via some kind of > simplistic mouse

Re: [racket-users] typed/rackunit and test-case

2015-05-24 Thread Alexis King
Since test-case is a macro, require/typed won't help, and unfortunately, test-case doesn't work in Racket v6.1.1 (or earlier). It will be fixed in the upcoming release, or you can download a snapshot build from here: http://www.cs.utah.edu/plt/snapshots/ Otherwise, I don't think there's much yo

Re: [racket-users] Generic collections in Racket

2015-05-25 Thread Alexis King
> I recently hacked together a little GUI thingy for showing > enumerations that just let them scroll by inside what looks like the > normal enumeration print out and it works by sampling and caching the > first 200 elements of the enumeration, but being careful about errors > and to staying the us

Re: [racket-users] Generic collections in Racket

2015-05-25 Thread Alexis King
> With fallback methods, you can get the best of both worlds. > > You can have a base set of methods that implementers of the interface > need to write, and from which everything else can be derived. The > derived methods can also be present in the interface, which allows > implementers to overrid

Re: [racket-users] Generic collections in Racket

2015-05-26 Thread Alexis King
> Alexis, think of a lazy sequence as something that the rest of the program > will explore. In addition to a GUI-based exploration, I would love to see a > programmatic one. Imagine > > (explore-lazy lazy-sequence:exp strictness-pattern:exp) > > where (the value of) strictness-pattern is a f

[racket-users] Capturing sets of options in a splicing syntax class?

2015-05-26 Thread Alexis King
When using syntax/parse, is there a good way to do something like this? (define-splicing-syntax-class options (pattern (~seq (~or (~optional (~seq (~and #:a a?))) (~optional (~seq (~and #:b b?))) (~optional (~seq (~and #:c c?))) (

Re: [racket-users] Capturing sets of options in a splicing syntax class?

2015-05-27 Thread Alexis King
rse #'(m #:op max 1 2 3) > [(_ (~optional (~seq #:op op:expr)) arg:expr ...) > (template ((?? op +) arg ...))]) > # > > > > > > On Wed, May 27, 2015 at 12:03 AM Alexis King wrote: > When using syntax/parse, is there a good way to do someth

[racket-users] Persistent vectors: a generic collections proof-of-concept

2015-05-28 Thread Alexis King
As a followup to my last thread regarding my generic collections library, I have now created a package that uses it to define an entirely new data structure. I've implemented Clojure's 32-way bitmapped tries to create a persistent vector implementation. If you're interested in trying it out, it'

Re: [racket-users] Re: Persistent vectors: a generic collections proof-of-concept

2015-05-29 Thread Alexis King
> Maybe this belongs a bit more to your previous thread, but it can also relate > here: > I see you are making generic sequence interface to collections. Clojure from > 1.7 seems to move more towards "reducebles" rather than "sequable". I have > played with this idea for Racket a bit and it seem

Re: [racket-users] Persistent vectors: a generic collections proof-of-concept

2015-05-29 Thread Alexis King
> How does this compare to https://github.com/ijp/pfds/ or the work described > in http://www.ccs.neu.edu/racket/pubs/sfp10-kth.pdf ? In the case of the former, that targets R6RS, while this is intended to be a more “native” Racket solution. The latter is in Typed Racket, while this is currentl

Re: [racket-users] Re: Persistent vectors: a generic collections proof-of-concept

2015-05-29 Thread Alexis King
> Hi, the full code is attached (I hope Google Groups will preserve it...). Thank you for this! There is absolutely a performance gap, and I'll definitely look over it and see if I can figure out exactly why (I think a well-built sequence-based model should have comparable speed). I did implemen

Re: [racket-users] Persistent vectors: a generic collections proof-of-concept

2015-05-29 Thread Alexis King
> My lazy-sequence implementation was exactly following SICP: while > theoretically pure and good, might not be the best in practice, so I believe > your implementation can be much better. > > Major performance boost in stateful implementation compared to lazy-sequence > with delay and force co

Re: [racket-users] strange bug with racket/gui

2015-06-02 Thread Alexis King
The problem here is that paint-callback is not called synchronously when you create a new canvas%, so before the callback code runs, the code following the creation of the canvas already attempts to use the drawing context. Since canvas% implements canvas<%>, could you use the get-dc method of

[racket-users] DrRacket seems to ignore print-reader-abbreviations?

2015-06-07 Thread Alexis King
When using DrRacket, the following program prints this output, which surprises me: > (print-as-expression #f) > (print-reader-abbreviations #f) > (print '(1 ,2 3)) (1 ,2 3) Evaluating the same thing from the CLI gives me the result I'd expect: -> (print-as-expression #f) -> (print-reader-abbrev

Re: [racket-users] DrRacket seems to ignore print-reader-abbreviations?

2015-06-08 Thread Alexis King
> My guess is that the right thing would be to make pretty-print react to those > parameters the way print does but I'm not completely certain. That sounds right. The documentation for pretty-print already lists this: > In addition to the parameters defined in this section, pretty-print conform

Re: [racket-users] DrRacket seems to ignore print-reader-abbreviations?

2015-06-08 Thread Alexis King
Looking at this a little bit more, it appears pretty-print has its own mechanism for controlling reader abbreviations, in the form of pretty-print-abbreviate-read-macros. Oddly enough, setting this to #f still causes DrRacket to use abbreviations. > (print-as-expression #f) > (pretty-print-abbr

Re: [racket-users] Sending RESTful Commands using Racket

2015-06-17 Thread Alexis King
You probably want to use the net/http-client library, specifically the http-sendrecv function. I’m not 100% sure, but I’d guess that the equivalent Racket code for your curl command would look something like this. (require net/http-client net/uri-codec) (http-sendrecv "192.168.1.20" "

Re: [racket-users] Closing big-bang windows

2015-06-21 Thread Alexis King
> I guess I could add a close-on-stop clauses for programmers > such as your son but it sounds almost like he's ready to move > on to racket proper, as in use the Windowing API directly. FWIW, despite big-bang’s position as a teaching tool, I much prefer it over using the Windowing API directly,

Re: [racket-users] Fast way to map over a list many times, changing ONE element each time?

2015-06-21 Thread Alexis King
As it turns out, this is a perfect application for my persistent vectors library. I used the following test harness, matching your examples and using the more “elegant” style of tackling the problem using for loops. I think the performance speaks for itself. #lang racket/base (require alexis

Re: [racket-users] Closing big-bang windows

2015-06-23 Thread Alexis King
I, for one, thought the idea of “OS” reads and writes from Get Bonus was a neat abstraction, even if it is more or less just functional reads and writes to a giant hash table. Obviously that’s more complicated than would be appropriate for big-bang, but I thought I’d bring it up anyway. > On Ju

[racket-users] Using ‘except-in’ to exclude identifiers for a single phase level

2015-06-28 Thread Alexis King
I ran across some behavior that I find a little bit surprising. Consider the following module: #lang racket/base ; the definition of some-fn (module a racket/base (provide some-fn) (define (some-fn) (void))) ; provides some-fn in multiple phase levels (module b racket/base

Re: [racket-users] Using ‘except-in’ to exclude identifiers for a single phase level

2015-06-28 Thread Alexis King
You're right, that works for including some-fn in phase 1 but not phase 0. The trouble is that I actually want the inverse of that: some-fn should be defined in phase 0 but not phase 1. (require 'c) some-fn ; defined here (begin-for-syntax some-fn) ; not defined here I haven't figured

Re: [racket-users] Using ‘except-in’ to exclude identifiers for a single phase level

2015-06-28 Thread Alexis King
Nope, that doesn’t work. If you try it, you’ll see that some-fn is still available in phase 1. That’s because the (provide (all-from-out (submod ".." b))) provides it as well, which is why I’ve been struggling. > On Jun 28, 2015, at 13:09, Benjamin Greenman wrote: > > No problem, just change t

Re: [racket-users] Using ‘except-in’ to exclude identifiers for a single phase level

2015-06-28 Thread Alexis King
I think it might be time for me to disclose what I’m actually trying to do here to make it more clear. As mentioned in my original message, I’m trying to make a module language just like r5rs but with support for syntax-case macros. This was my attempt: #lang racket/base (require (except-in r5

Re: [racket-users] Using ‘except-in’ to exclude identifiers for a single phase level

2015-06-29 Thread Alexis King
Thanks for your help. I did consider the only-meta-in approach, but then I’d be excluding the syntax-rules export as well, which I was trying to avoid if possible. > On Jun 29, 2015, at 7:39 AM, Matthew Flatt wrote: > > You're right that there's not a form that's like `except-out` but > constr

Re: [racket-users] API function naming

2015-07-03 Thread Alexis King
Perhaps this isn’t applicable in this case, but may I suggest a less-common alternative: no prefixing at all? If you put all the commands into a separate module, users of the module can use ‘prefix-in’ to choose whatever prefix they prefer. This can be paired with documentation that uses a part

Re: [racket-users] API design 2 -- variadic styles

2015-07-06 Thread Alexis King
I’ll second Stephen’s point about keyword arguments. They’re quite common in idiomatic Racket, and they are probably the most direct way to address the points you’ve mentioned. Another tool that Racket gives you to make scripting very easy is the ability to create fairly expressive DSLs with li

[racket-users] Are there any BDD testing frameworks for Racket?

2015-07-11 Thread Alexis King
RackUnit is a good tool, but the interface it provides is pretty bare-bones. It’s mostly just assertions, with a few grouping utilities like test-case and test-suite. The core is solid, but I think it would be nice to have BDD-style assertions on top, and I was wondering if such a project alread

Re: [racket-users] Are there any BDD testing frameworks for Racket?

2015-07-12 Thread Alexis King
> Short version: I think it's a good idea. I don't know of anything like > that, yet. I'm interested in BDD, but not so much a Gherkin style DSL. Yeah, I currently have no plans to implement something like Gherkin. All I care about for the time being is spec-style `describe`, `context`, `it`, and

Re: [racket-users] eval PSA (was Sending Closures to Places)

2015-08-04 Thread Alexis King
> I don't know why but at some point in the 20th century people really became > afraid of viewing programs as pure data (which they are) and started to call > it metacircular (which of course also refers to other properties of a list > processor treating each and every start of list, i.e. openin

Re: [racket-users] Export indentation preferences in a package's info.rkt?

2015-08-11 Thread Alexis King
IMO, the truly Racket-y way would be to attach a syntax property to the exported identifier that has information about how it should be indented. This is actually a major improvement over the current way DrRacket handles indentation because it would handle forms by their syntactic binding rather

[racket-users] Creating a language that extends typed/racket

2015-08-30 Thread Alexis King
(Disclaimer: I think this question may have been visited before on this mailing list, but I couldn’t find any resolution, so I’m going to ask again.) I would like to write a language that extends typed/racket or typed/racket/base. Specifically, I have a collection, called “envy”. I would like t

[racket-users] Re: [racket-dev] Racket Package Server Security Vulnerabilities

2015-09-21 Thread Alexis King
> * Change your password on the http://pkgs.racket-lang.org site. For anyone confused about how to do this, I just spent a few minutes trying to figure it out, myself. You have to log out, then log back in with your email address and intentionally specify an incorrect password. The package serve

Re: [racket-users] Question about structuring recursive code

2015-09-23 Thread Alexis King
> Ok. Yeah, if- branches aren't allowed to have definitions, or even sequences > of operations. You can get around this with begin Er, no you can’t... `begin` doesn’t create an internal definition context (or even a new scope). You can use an empty `let` instead: (define (f x) (if (even? x)

[racket-users] Redirecting Scribble cross-references for non-core packages?

2015-10-01 Thread Alexis King
I’ve set up a system to automatically build docs for my “envy” package in CI. I’m passing the --redirect-main flag to point all the external links to http://pkg-build.racket-lang.org/doc/. This works great for all the links that point to references in the core distribution, but for some reason,

Re: [racket-users] Redirecting Scribble cross-references for non-core packages?

2015-10-02 Thread Alexis King
Yep, that was it! Thanks a lot for identifying the problem. I’m now explicitly installing into installation scope, which solves the problem. It does seem surprising that --redirect-main doesn’t redirect references to documentation in user scope. It would be nice if that were changed so that both

[racket-users] Standardizing the threading macro and organizing packages

2015-10-07 Thread Alexis King
While in St. Louis, I had a brief conversation with Jay, Alex, and Jack about how we all happen to have our own implementation of Clojure’s threading macro. That macro is called -> in Clojure, but I believe Greg’s rackjure library set the Racket standard of calling it ~>, since the arrow is alre

Re: [racket-users] Standardizing the threading macro and organizing packages

2015-10-07 Thread Alexis King
> If this isn't going to be added to the core (and I don't think it should), > then there would need to be some work done on exposure and making sure > everyone who wants this functionality knows "look here first and only roll > your own if this isn't specific enough”. This is a good point, and

Re: [racket-users] Standardizing the threading macro and organizing packages

2015-10-08 Thread Alexis King
I decided to release my threading implementation as the “threading” package. The documentation is here: http://pkg-build.racket-lang.org/doc/threading/index.html I’m okay with this because I wanted to pull them out of my utils package, anyway, and they’re nice to have, even if we come up with a

Re: [racket-users] Standardizing the threading macro and organizing packages

2015-10-08 Thread Alexis King
> On Oct 8, 2015, at 11:08 AM, Alex Knauth wrote: > > You don't think > (define-simple-macro (-> var:id expr:expr ...+) > (let* ([var expr] ...) var)) > > Is better? No, actually I, I don’t. Threading macros are a convenience, just like anonymous functions. I’d rather keep them simple and e

Re: [racket-users] Standardizing the threading macro and organizing packages

2015-10-08 Thread Alexis King
> My macro and Jack Firth's function both allow that. Sounds like the solution is to go with a function instead of a macro then. If you want that flexibility, I don’t think there’s any reason to stick with a macro, anyway. The point-free package is very nice. Alexis -- You received this mess

Re: [racket-users] Standardizing the threading macro and organizing packages

2015-10-08 Thread Alexis King
> On Oct 8, 2015, at 1:34 PM, Jay McCarthy wrote: > > FWIW, I find my threading macro to be very powerful, pretty clear when > used complicatingly, and at about power-level 9,000: > > https://github.com/jeapostrophe/exp/blob/master/threading-arrow.rkt I have to agree with Jack and Alex here: I

Re: [racket-users] Naming for generalization of find-min and find-max?

2015-10-11 Thread Alexis King
> You will be far more confusing for people who know the old names (from > 1960foobar) and can’t find the new ones. I have been looking into how to add index aliases for Scribble docs to address this problem. This may lead to another mailing list thread. -- You received this message because y

Re: [racket-users] Representing invalid values for non-negative integer variables

2015-10-11 Thread Alexis King
The Scheme convention for absence of a value, inherited by Racket, is to use #f since it is the only falsy value. This make it easy to branch on the presence or absence of a value. Typed Racket reinforces this convention: it has an (Option t) type constructor that is an alias for (U t #f), whic

Re: [racket-users] Naming for generalization of find-min and find-max?

2015-10-12 Thread Alexis King
I’m not completely sold on `most`, but I’m close. I like that it’s terse and fairly obvious in what it does. The obvious downside is that it’s a little vague. The expression (most < lst) doesn’t read super well, IMO. I think passing a less-than? argument makes this function much closer conceptu

Re: [racket-users] Long-term Runtime session state

2015-10-13 Thread Alexis King
Have you taken a look at parameters? http://docs.racket-lang.org/guide/parameterize.html http://docs.racket-lang.org/reference/parameters.html There is also a way to “link units at runtime”, conveniently called “units”. http://docs.racket-lang.org/guide/units.html?q=unites#%28tech._unit%29 http:

Re: [racket-users] racket users fight for their right to colon keywords

2015-10-14 Thread Alexis King
> It's not "forking the language", it's turning into an opt-in library. The > huge difference between the colon-kw language mixin and that paddle/base > language is that the form isn't a language. It can be provided to any > language. If your paddle/base language didn't provide colon keywords, y

Re: [racket-users] DrRacket indentation adds spaces to empty non-top-level lines?

2015-10-21 Thread Alexis King
This might be a relevant thread: https://groups.google.com/d/msg/racket-users/5pxs1pM-8lE/uh0yn9D0QHYJ (It also might not be. I’m not really sure if it addresses your issue or not.) > On Oct 21, 2015, at 12:47 PM, Paolo Giarrusso wrote: > > Hi all! > > Every time I reindent a file with DrRacke

Re: [racket-users] racket users fight for their right to colon keywords

2015-10-22 Thread Alexis King
> And I'm surprised how many people claim to love #:keyword. (The engineering > opposition to any non-backward-compatible change was entirely predictable, > but I assumed only a small percentage would actually prefer #:keyword, due to > familiarity or different aesthetic wiring, and that around

  1   2   3   4   >