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

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

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

2015-03-27 Thread Alexis King
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 lexi.lam...@gmail.com javascript:_e(%7B%7D,'cvml','lexi.lam...@gmail.com'); wrote: It might be interesting to create a binary s-expression format for more

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
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 handshake isn't there. Jay On Sat, Mar 21, 2015 at 8:44 PM, Alexis King lexi.lam...@gmail.com wrote: The WebSocket

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

2015-03-27 Thread Alexis King
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 lexi.lam...@gmail.com javascript:_e(%7B%7D,'cvml','lexi.lam...@gmail.com'); wrote: It might be interesting to create a binary s-expression format for more

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 plra...@uwaterloo.ca wrote: When I am editing a Scribble file in DrRacket and use Save Definitions As... to start a new version, the system file

[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 lexi.lam...@gmail.com wrote: I’m working my way through

[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

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

[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

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

[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

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

[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

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

Re: [racket-users] the Racket manifesto

2015-04-09 Thread Alexis King
I think Greg Hendershott’s Fear of Macros http://www.greghendershott.com/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 ge...@knauth.org wrote: Since from his first months

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

2015-05-20 Thread Alexis King
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 konrad.hin...@fastmail.net wrote: On 20/05/2015 04:24, Alexis King wrote: I'm trying to implement a for/stream loop using for/fold/derived that will return

[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

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

2015-05-19 Thread Alexis King
-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 King lexi.lam...@gmail.com wrote: I'm

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 conforms

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)

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) -

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

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

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] 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 currently

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

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 seems to

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

2015-05-27 Thread Alexis King
op:expr)) arg:expr ...) (template ((?? op +) arg ...))]) #syntax:198:0 (max 1 2 3) On Wed, May 27, 2015 at 12:03 AM Alexis King lexi.lam...@gmail.com wrote: When using syntax/parse, is there a good way to do something like this? (define-splicing-syntax-class options (pattern

[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?)))

[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,

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 comes

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

[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-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 mfl...@cs.utah.edu wrote: You're right that there's not a form that's like

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 bl...@cornell.edu wrote: No problem,

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

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

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 care

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-25 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

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 user's

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 override

[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: $

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 acarr...@memebeam.org wrote: Has this been an oversight? Do we need two official test submodules?

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

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

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. opening

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

2015-08-12 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

Re: [racket-users] Getting the "require" syntax arrows to work right

2015-10-24 Thread Alexis King
Aha, yes, that seems to work. I should have thought of that, but I actually didn’t know you can just copy all properties over with datum->syntax, haha. I guess I should have read the docs for that more carefully. This does seem a little bit like cheating because now the macro-generated

[racket-users] Getting the "require" syntax arrows to work right

2015-10-24 Thread Alexis King
I’ve been toying with the idea of making an R7RS implementation in Racket, and one of the things I’ve implemented is the R7RS `import` form. It’s very easy to implement in Racket, and it works fine as far as I can tell, but I can’t figure out how to get the special binding arrows to cooperate

[racket-users] Why doesn't syntax/module-reader work with extra-argument read procedures?

2015-10-25 Thread Alexis King
When discussing custom `read` and `read-syntax` implementations, the Racket reference states this in section 1.3.18, Reading via an Extension: > The arity of the resulting procedure determines whether it accepts extra > source-location information: a read procedure accepts either one argument >

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

[racket-users] syntax-original? always returns #f within syntax transformers?

2015-10-27 Thread Alexis King
I wrote a simple program that determines whether a piece of syntax is original in two different ways: (define-syntax (print-original stx) (syntax-case stx () [(_ datum) (begin (displayln (syntax-original? #'datum)) #'#'datum)])) (syntax-original? (print-original 'foo))

[racket-users] R7RS (small) in Racket

2015-10-25 Thread Alexis King
I have built a very small, very incomplete implementation of R7RS in Racket. You can install the “r7rs” package, or you can find it on GitHub here: https://github.com/lexi-lambda/racket-r7rs Most of the standard seems fairly straightforward, but there are two questions I have. First of all, do

[racket-users] Re: make-readtable with no arguments produces an incompatible readtable?

2015-11-02 Thread Alexis King
because the reader doesn’t get that far to actually execute the reader extension. Is there any feasible way to fix this in a general sense without reimplementing the entire list reader? Or will I just have to not support this on current versions of Racket? > On Nov 2, 2015, at 8:36 PM, Ale

[racket-users] Changing reader parameters from within a reader extension

2015-11-02 Thread Alexis King
Hi all, I’m continuing to implement R7RS in Racket, and I think I’ve gotten most of the way aside from the various reader differences. The trickiest thing seems to be the #!fold-case and #!no-fold-case directives, which adjust the case-sensitivity of the reader as a side-effect. I’ve

[racket-users] make-readtable with no arguments produces an incompatible readtable?

2015-11-02 Thread Alexis King
I came across some odd behavior today regarding readtables. Specifically, (make-readtable base) seems to produce a readtable that is operationally different from `base` when reading s-expression comments. Consider the following code: ; this works (read (open-input-string "(1 . 2 #;3)"))

[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

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,

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] 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,

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

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

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),

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

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

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

[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

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

[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

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

2015-10-02 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

[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

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)

Re: [racket-users] reducing pauses with incremental GC

2015-12-02 Thread Alexis King
Wow, this is great. I just tried it with one of my games that I made with big-bang, and the pauses I was having are completely gone, as far as I can tell. (I was doing quite a bit of copying, so I think the GC was triggering fairly often.) Thanks a lot for this; it’s definitely a big

Re: [racket-users] PSA: alexis/collection is dead, long live data/collection

2015-12-06 Thread Alexis King
The honest answer to your question is that I don’t know (though I’d also be interested to hear the answer). Obviously, I’d like to see generic APIs given more thought, but they are currently somewhat slow due to how dispatch is performed. I don’t think that’s a reason to design APIs in a

Re: [racket-users] PSA: alexis/collection is dead, long live data/collection

2015-12-09 Thread Alexis King
> On Dec 6, 2015, at 10:03 PM, George Neuner wrote: > > I would disagree that multiple dispatch isn't needed. The Visitor pattern is > used fairly frequently in real programs and it is just a overly complex, > error-prone way of doing double dispatch. Trying to handle

[racket-users] PSA: alexis/collection is dead, long live data/collection

2015-12-05 Thread Alexis King
Earlier this year, Jay suggested I move alexis/collection to data/collection and claim that namespace. In the past week, I’ve finally done so. Instead of using the alexis-collections package, just use the collections package. Otherwise, everything still works identically. The

Re: [racket-users] [ANN] trivial 0.1

2015-12-14 Thread Alexis King
This is pretty neat. Without looking too much into the documentation or implementation, could you briefly elaborate on why these changes are in a separate package rather than improvements to TR itself? At a quick glance, you mention doing some sort of static analysis on arguments in the normal

Re: [racket-users] about rackjure

2015-12-12 Thread Alexis King
Oft-forgotten feature about the curly-fn package: if you don’t include any arguments, it works as a shorthand for curry. So really, the idiomatic curly-fn solution would just be #{map sqr}, the shortest of the four. (Disclaimer: I wrote the curly-fn package.) Tongue-in-cheek comments aside,

Re: [racket-users] Ligatures for monospace fonts in editors?

2016-01-02 Thread Alexis King
This is well-timed, as I was wondering precisely the same thing myself just yesterday. Atom recently gained support for ligatures, and I was trying out Hasklig, since I normally use Source Code Pro as my monospace font. I tried it out in DrRacket as well, and I was disappointed (though not

[racket-users] How can I group optional attributes captured with syntax-parse?

2015-12-31 Thread Alexis King
I have created a splicing syntax class that captures keyword options that may be provided in any order. Using the ~optional ellipsis head pattern makes this easy enough: (define-splicing-syntax-class opts (pattern (~seq (~or (~optional (~seq #:a a)) (~optional

Re: [racket-users] Simple regex question. How to match this: "[X] foo"

2016-01-08 Thread Alexis King
> You could make a Racket reader that did this. Or you can find some of the > interesting s-expression regular expression languages (I think Olin Shivers > did one). Or just not use regexps so much > ("http://regex.info/blog/2006-09-15/247”). When telling someone to avoid something useful,

Re: [racket-users] [newbie] Help with streams

2015-12-20 Thread Alexis King
My “collections” package makes fairly heavy use of streams, so it provides a number of utilities to help with what you want to do. The obvious function here would be `generate-sequence`[1], which creates a stream from a generator. You can call `take` on the resulting sequence, since my generic

[racket-users] Error reporting with missing head patterns in syntax/parse

2015-12-19 Thread Alexis King
Consider a macro that works just like `define`, but only allows function definitions. Here’s a simple implementation using the function-header syntax class from syntax/parse/lib: (define-syntax (defn stx) (syntax-parse stx [(_ header:function-header body ...+) #'(define header

Re: [racket-users] Help updating racket/function

2015-11-19 Thread Alexis King
Ah, that’s my package, and that issue is my mistake. I had a version exception for 6.2, but I was missing a version exception for 6.2.1. It should work on 6.2.1 now. Try updating alexis-collections (or uninstalling/reinstalling it), and it pull the right version. Thanks for the report! Alexis

[racket-users] Proper handling for a custom current-read-interaction?

2016-06-06 Thread Alexis King
I am trying to write a custom current-read-interaction for a language with non-s-expression syntax, and I’m not sure I completely understand the protocol for how to detect the end of input across both the command line and DrRacket. I first wrote an implementation for DrRacket, which appears to

Re: [racket-users] Proper handling for a custom current-read-interaction?

2016-06-08 Thread Alexis King
Ah, ok, that (mostly) makes sense to me. I think this might be a little bit complicated, though: in this language, definitions can span multiple lines without necessarily any direct indication that they continue. Think Haskell-style pattern matching: fib 0 = 0 fib 1 = 1 fib n = fib (n - 1)

Re: [racket-users] R7RS implementation

2016-06-09 Thread Alexis King
Hey, I’m the maintainer of the R7RS library. I’d appreciate it if you filed those issues as bugs on the GitHub repository here: https://github.com/lexi-lambda/racket-r7rs I’m glad you found value in the library, and I’d love to try and fix some of the problems you mentioned, especially since a

Re: [racket-users] Custom color lexer for DrRacket that requires lookahead

2016-05-30 Thread Alexis King
> On May 30, 2016, at 12:23, Alexis King <lexi.lam...@gmail.com> wrote: > > Now the colorer attempts to lex the slash alone as a new token without > attempting to re-lex “foo”. Since a forward slash is not valid at the > beginning of an identifier, it is colored as an error.

[racket-users] Custom color lexer for DrRacket that requires lookahead

2016-05-29 Thread Alexis King
I’ve created a custom language with non-s-expression syntax, so I’ve written a lexer and connected it to the DrRacket syntax highlighter. This works pretty well, but I have a small problem: when modifying text that would cause earlier tokens in the stream to lex differently, I am unsure how to

[racket-users] Store value with unsupported type in Postgres?

2016-01-17 Thread Alexis King
The DB docs for SQL type conversions[1] note that not all Postgres types are supported by Racket, and it recommends using a cast to work around this. It even uses the inet type as an example right at the start of the page. However, I want to store an inet value in my database, not query an inet

Re: [racket-users] Store value with unsupported type in Postgres?

2016-01-17 Thread Alexis King
Perfect, that works great, thank you! It looks like the precedence works out such that I could do $1::text::inet and have it work properly, which is clean enough for my needs. > On Jan 17, 2016, at 16:39, Marc Burns wrote: > > You can cast first to a supported type: > >

Re: [racket-users] Store value with unsupported type in Postgres?

2016-01-17 Thread Alexis King
I would like to avoid interpolating into a query if at all possible, given that this string is not something I control. I could be very careful about validating or sanitizing it, but this is a pretty textbook use case for parameterized queries. > On Jan 17, 2016, at 16:19, Jon Zeppieri

[racket-users] Expression-style printing and quotation: helpful or harmful?

2016-02-05 Thread Alexis King
It is my understanding that “expression-style” printing was introduced to Racket v5.0, which alters how values are printed in the REPL to permit many printed expressions to be evaluated to produce the same value. In contrast to the traditional Scheme write procedure, this tends to manifest itself

Re: [racket-users] Expression-style printing and quotation: helpful or harmful?

2016-02-07 Thread Alexis King
I appreciate your input, Matthew, but the location of the documentation is a separate conversation—the point seems to be that the current documentation is insufficient. Throwing a whole book at someone who is confused about apostrophes in their programs’ output is not an ideal answer, in my

  1   2   3   4   >