[racket-users] pict/code with other languages

2015-03-26 Thread Jack Firth
I'd like to typeset some Javascript code in a way similar to what pict/code allows, but the naive approach of (code someFunc(someArg, someOtherArg)) doesn't quite work because of the reader adding whitespace in various places. pict/code seems to be purely oriented towards working with racket

[racket-users] Re: pict/code with other languages

2015-03-26 Thread Jack Firth
Fantastic, thank you. Sidenote - I had to (require java-lexer) instead of (require java/code) like the readme says. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email

[racket-users] Syntax parameters and renaming

2015-05-05 Thread Jack Firth
I find that 99% of the time when I'm using syntax parameters, I'm just using them with make-rename-transformer to implement macro-dependent keyword-like things, such as `aif` and `it`. So I made a small helper macro syntax-parameterize-rename: (syntax-parameterize-rename ([param #'foo]) ...)

Re: [racket-users] scribble namespace landgrab embedded package documentation

2015-05-08 Thread Jack Firth
Additionally if it were it's own lang extension, the tool using this information wouldn't need to do the parsing. The reader could extract all the ;;; definitions into a submodule that the tool requires. On Thursday, May 7, 2015 at 11:44:59 AM UTC-7, Matthew Flatt wrote: I have no problem with

[racket-users] Re: pkg-build report for the v6.2 release candidate

2015-05-15 Thread Jack Firth
On Thursday, May 14, 2015 at 5:36:23 PM UTC-7, Matthew Flatt wrote: Here are the results of a package build using the v6.2 release candidate: http://release-pkg-build.racket-lang.org.s3-website-us-west-2.amazonaws.com/ Compare to v6.1.1: http://pkg-build.racket-lang.org/ For the

[racket-users] Constant syntax coloring?

2015-04-09 Thread Jack Firth
The DrRacket Check Syntax button colors syntax in a helpful way, particularly the distinction it makes between required/language bindings and bindings defined in the module. However, as soon as I type anything the coloring disappears. This wouldn't be so bad if it reappeared the next time

[racket-users] Re: how to add file types to `raco test`?

2015-07-06 Thread Jack Firth
On Sunday, July 5, 2015 at 4:51:22 PM UTC-7, Matthew Butterick wrote: `raco test` will automatically test every .rkt and .scrbl file in a directory. Suppose I make `#lang foo` and thus many of my test files end with .foo. I would want all .foo files to be automatically tested as well. Is

Re: [racket-users] Capability security in Racket?

2015-08-19 Thread Jack Firth
This idea in general is very cool, so do let us (or at least me) know when you've got a prototype working. I'm quite curious to see the inner workings. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop

[racket-users] Some testing libraries

2015-08-20 Thread Jack Firth
I've made some libraries to assist testing. One is for integration testing and also making REST request simpler in general, and the other is for making mocks of procedures and checking they're called with certain arguments. The packages are named request

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Jack Firth
On Monday, August 17, 2015 at 9:07:15 AM UTC-7, Matthew Flatt wrote: That's an especially basic mistake, and it slipped by because low-level locks are rarely allocated in the run-time system. Place channels are probably the simplest way to trigger new locks, but the test that checks for leaks

[racket-users] Re: Slack team for racket

2015-07-31 Thread Jack Firth
On Monday, July 27, 2015 at 1:15:31 AM UTC-7, mazert wrote: Le 27/07/2015 04:13, Jason Yeo a écrit : Hi Everyone! For anyone out there who finds IRC too daunting and difficult to use, there's a slack team created just for racketlang at http://racket.slack.com. Get invites to the team

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

2015-08-09 Thread Jack Firth
I find it irritating when I have to repeatedly add various macros exported by libraries to their proper group in the Indenting section of DrRacket's settings so that they're properly formatted. Is there a way for a package's info.rkt to specify default indentation preferences for it's macros

[racket-users] Pict circle radius

2015-07-25 Thread Jack Firth
So the documentation says that (circle 100) produces a circle with radius 100. However, (pict-width (circle 100)) produces 100 instead of 200, so apparently it's a circle with diameter 100 and radius 50? Is this a misdocumented function, or am I missing something embarrassingly obvious? --

[racket-users] Re: Macro to extract select subexpressions into other locations

2015-07-25 Thread Jack Firth
On Monday, July 20, 2015 at 5:03:55 PM UTC-7, Jack Firth wrote: I'm trying to create a way to automatically turn test cases into examples. I'd like a macro that turns this: (extract-expressions (module+ test (check-equal? (extract-expression (square 5)) 25) (check-equal? (extract

Re: [racket-users] Pict circle radius

2015-07-25 Thread Jack Firth
Indeed it turns out I was missing something embarrassingly obvious. I was looking at the docs for the 2htdp/image functions, but using the pict functions. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop

[racket-users] Re: How to draw a 3D ball?

2015-07-19 Thread Jack Firth
On Saturday, July 18, 2015 at 7:30:42 PM UTC-7, Mianlai Zhou wrote: Hi all, I am wondering how to change the following code of a 2D circle into a 3D ball: (require slideshow) (colorize (filled-ellipse (* size 15) (* size 15)) red) My intention is to make the picture look like a

[racket-users] Macro to extract select subexpressions into other locations

2015-07-20 Thread Jack Firth
I'm trying to create a way to automatically turn test cases into examples. I'd like a macro that turns this: (extract-expressions (module+ test (check-equal? (extract-expression (square 5)) 25) (check-equal? (extract-expression (square -5)) 25)) (module+ doc @defproc[(square [x

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

2015-10-22 Thread Jack Firth
Perhaps it would have been better phrased as "Which do you prefer, #:keyword or :keyword?" with options like "strongly prefer x", "prefer x", "indifferent", "prefer y", "strongly prefer y", rather than two different 1-10 scales. -- You received this message because you are subscribed to the

Re: [racket-users] Testing environment variable changes

2015-10-21 Thread Jack Firth
On Tuesday, October 20, 2015 at 11:56:33 AM UTC-7, Tim Brown wrote: > I'm not sure if I'd want to be able to arbitrarily change > current-proxy-servers on the fly (something that has proven difficult, > highlighted by the hoops I have to jump through in the tests). On the other > hand it's

[racket-users] Re: Reliable equality testing of procedures

2015-11-04 Thread Jack Firth
On Wednesday, November 4, 2015 at 8:14:42 AM UTC-8, erich wrote: > Hi, > > I have a number of functions for computing raw distance measures and > functions to compute their maxima for a given number of items, so to > normalize them to [0,1] I provide this: > > (define (normalize/distance measure

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

2015-10-07 Thread Jack Firth
I definitely like standard packages, but how will we avoid the problem of this becoming just another threading macro package instead of an actual standard? I also feel like something similar would be useful for anonymous functions, what with curly-fn, rackjure, fancy-app, the cut and cute

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

2015-10-14 Thread Jack Firth
On Wednesday, October 14, 2015 at 3:45:46 PM UTC-7, Neil Van Dyke wrote: > Alex Knauth wrote on 10/14/2015 05:57 PM: > > > > > It's not worth changing the default for all of racket just to avoid > > putting #lang colon-kw racket at the top of a program. > > > > I currently have the opposite

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

2015-10-08 Thread Jack Firth
I agree about using the function form for flexibility. (Alliteration!) The macro form should be optimized for simple cases, because macros by nature are less flexible. If you have a complex case, write actual functions. You'll spend less time wrangling the syntax system that way. On Thu, Oct 8,

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

2015-10-08 Thread Jack Firth
The more I think about it, the more I realize I really dislike specifying the position of arguments in these anonymous function syntaxes. For instance I would prefer this: (λ (x y) (/ y x)) To this: λ.(/ $.1 $.0) In the common case, you won't need to flip any argument orders around. In that

Re: [racket-users] package-build status for upcoming release

2015-10-07 Thread Jack Firth
command-line-ext is indeed failing because of mischief, and I removed that dependency the other day. jack-mock is failing due to attempting to require `unstable/sequence`, I don't remember offhand which package that's in now. -- You received this message because you are subscribed to the

[racket-users] Re: Official Docker images for Racket

2015-09-04 Thread Jack Firth
On Friday, September 4, 2015 at 4:51:43 AM UTC-7, Juan Francisco Cantero Hurtado wrote: > On 09/03/2015 08:07 AM, Jack Firth wrote: > > I've attempted to compile from source in an alpine image, but with no > > success. There's a bit too much arcane magic there for me to figure out

[racket-users] Re: Official Docker images for Racket

2015-09-04 Thread Jack Firth
On Friday, September 4, 2015 at 8:23:14 AM UTC-7, Juan Francisco Cantero Hurtado wrote: > On 09/04/2015 04:59 PM, Jack Firth wrote: > > On Friday, September 4, 2015 at 4:51:43 AM UTC-7, Juan Francisco Cantero > > Hurtado wrote: > >> On 09/03/2015 08:07 AM, Jack Firth wro

[racket-users] Re: Official Docker images for Racket

2015-09-06 Thread Jack Firth
On Sunday, September 6, 2015 at 10:56:16 AM UTC-7, Juan Francisco Cantero Hurtado wrote: > On 09/06/2015 01:05 PM, Jack Firth wrote: > > Alpine provides a glibc package, could I just swap out for that instead? > > No, they don't provide glibc: > https://pkgs.alpinelinux.org/p

Re: [racket-users] Re: Official Docker images for Racket

2015-09-07 Thread Jack Firth
On Monday, September 7, 2015 at 12:49:11 AM UTC-7, daniel wrote: > Yes, thanks for providing the images. I tested a bit and it worked very > well. I like the idea of the "ONBUILD" images. > > Daniel. Those are experimental at the moment, I may change the interface they use sometime in the near

[racket-users] Re: Official Docker images for Racket

2015-09-03 Thread Jack Firth
I've attempted to compile from source in an alpine image, but with no success. There's a bit too much arcane magic there for me to figure out how to do that. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and

[racket-users] Official Docker images for Racket

2015-09-02 Thread Jack Firth
I do a lot of Racket development in Docker, and it's a pretty big pain. There's a handful of images on Docker Hub but they're pretty unmaintained, usually lag behind a version or two, tend to be built off an unnecessarily large base image like ubuntu, don't offer a snapshot build, and don't

[racket-users] Re: Official Docker images for Racket

2015-09-06 Thread Jack Firth
On Saturday, September 5, 2015 at 2:54:42 PM UTC-7, Juan Francisco Cantero Hurtado wrote: > On 09/04/2015 10:32 PM, Jack Firth wrote: > >> > >> Virtualbox -> Linux -> Docker -> Alpine > >> ^ > >> > >> Which Linux dis

Re: [racket-users] Re: Official Docker images for Racket

2015-09-03 Thread Jack Firth
> Perhaps you could provide your Dockerfile etc. on Github so others could > look into it and maybe give some hints. I've got them up at https://github.com/jackfirth/racket-docker, and they're on Docker Hub as https://hub.docker.com/r/jackfirth/racket/. Currently the images are built off Debian

[racket-users] RabbitMQ

2015-09-10 Thread Jack Firth
Has anyone implemented a RabbitMQ client in racket? Is anyone working on it and partway there? I'm trying to set up a distributed task system like Celery in Python which needs the workers to be in Racket. -- You received this message because you are subscribed to the Google Groups "Racket

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

2015-12-02 Thread Jack Firth
Absolutely fantastic! I wonder how often language designers implement features useful to game developers because of their children. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from

[racket-users] Re: about rackjure

2015-12-12 Thread Jack Firth
There's also the fancy-app, curly-fn, and afl packages for different ways of writing anonymous functions (cut and cute from srfi/26 always seemed awkward to me). cut: (cut map sqr <>) fancy-app: (map sqr _) curly-fn #{map sqr %} afl: #λ(map sqr %) point-free doesn't give you special syntax

Re: [racket-users] about rackjure

2015-12-12 Thread Jack Firth
> This is an area in which there are probably too many options, but opinions > are strong, and we have not standardized (yet). Feedback is welcome! Speaking of which, there's also the `threading` package, which I really should add the point-free version of ~> to. -- You received this message

[racket-users] Re: auto-defining variables mentioned in a program

2016-06-02 Thread Jack Firth
On Thursday, June 2, 2016 at 10:06:25 AM UTC-7, Matthew Butterick wrote: > I have a solution to this problem — is it legit, or is there some slick > Rackety technique I'm missing? > > I'm making a toy #lang interpreter for Basic, which allows variables to be > created with an assignment

[racket-users] Re: auto-defining variables mentioned in a program

2016-06-02 Thread Jack Firth
#%top provides fallback behavior at compile time, but only in expression positions. I think what you want can be done by doing this: - Under the hood, make variables immutable and have their values be boxes. - Have (set! x:id expr) and (define x:id expr) both expand to (box-set! x expr). This

[racket-users] Re: auto-defining variables mentioned in a program

2016-06-02 Thread Jack Firth
Erm, set-box! not box-set! My bad. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit

[racket-users] Re: Code critique request: data/fetch, proc for walking hashes/lists

2016-01-11 Thread Jack Firth
I'd probably prefer using a fold over explicit recursion. This gets easier if you split your code into two steps - one that does just one level of lookup, and one that does nested lookups. Additionally, I'd prefer list indexes rather than pair lookup functions: (define (data/ref s key) (cond

[racket-users] Re: Code critique request: data/fetch, proc for walking hashes/lists

2016-01-11 Thread Jack Firth
I'd probably prefer using a fold over explicit recursion. This gets easier if you split your code into two steps - one that does just one level of lookup, and one that does nested lookups. Additionally, I'd prefer list indexes rather than pair lookup functions: (define (data/ref s key) (cond

[racket-users] How do I use fetch-blueboxes-strs?

2016-01-14 Thread Jack Firth
fetch-blueboxes-strs claims in its documentation it can get the text of a Scribble bluebox, but I have no idea how to actually use it. Attempting to get the bluebox content of "list-ref", the following all either fail or return #f: (fetch-blueboxes-strs 'list-ref) (fetch-blueboxes-strs

Re: [racket-users] How do I use fetch-blueboxes-strs?

2016-01-14 Thread Jack Firth
Ah hah! Thanks for that link Robby. The appropriate definition tag for list-ref is '(def ('#%kernel list-ref)). Extracted this function for figuring out the definition tag of an identifier in an installed module: (define (find-definition-tag identifier) (xref-binding->definition-tag

[racket-users] Re: How do I use fetch-blueboxes-strs?

2016-01-14 Thread Jack Firth
Samth's example doesn't work for me, even after raco setup -xl. I'm on version 6.3 -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[racket-users] Slack IRC bridge malfunctioning

2016-02-07 Thread Jack Firth
The Slack channel that mirrors the messages in the IRC hasn't seen any messages in the last few days. I checked the archives and there are a few messages in the Slack channel that didn't make it across the bridge into irc-land either. Would whoever set up the bridge between the two be willing

[racket-users] Re: anyone using MongoDB 2.x or 3.2 with Racket 6.x ?

2016-02-08 Thread Jack Firth
That library is the old Planet one, Racket has a new package management system and the mongodb package has been moved to it. Try running `raco pkg install mongodb` at a terminal (or installing through DrRacket's GUI) and then `(require mongodb)`. The package server

[racket-users] Re: Slack IRC bridge malfunctioning

2016-02-08 Thread Jack Firth
Slack's business model would be negatively affected by user data mining. They operate on a "free for small hobbyist use, expensive for large corporate use". Corporations do not like when you mine their data and are generally able to do far more about it than average citizens. By default Slack's

[racket-users] Re: Slack IRC bridge malfunctioning

2016-02-09 Thread Jack Firth
I'd like to note that the bridge has been restored, and the wormhole is functioning properly now. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[racket-users] Re: Implement Topological sorting in HtDP-y way?

2016-01-28 Thread Jack Firth
Out of idle curiosity: why `(define (topological-sort ...) (local ((define (topological-sort ... done)) (topological-sort ... '())` rather than using a local define and a different name like `topological-sort/accumulator`? -- You received this message because you are subscribed to the Google

[racket-users] Docker images updated

2016-02-24 Thread Jack Firth
Hey all, I've made some pretty significant changes to the racket Docker images: 1) 6.4 and 6.3 support (took long enough...) 2) Onbuild images for running and testing apps for every 6.x version, additionally the onbuild images were changed to run "racket main.rkt" as their command after doing a

[racket-users] Re: `compile-omit-paths` seems to be ignored when creating a package.

2016-02-27 Thread Jack Firth
I think compile-omit-paths only works in an info file for a collection, not a package. So you'd have to put it in an info file in the samples/ directory and tell it to exclude everything in that collection. -- You received this message because you are subscribed to the Google Groups "Racket

[racket-users] Slack IRC bridge down again

2016-03-25 Thread Jack Firth
Slack room shows no new messages since Tuesday, yet IRC archives state the room is as active as ever. Messages from the slack side aren't crossing over to IRC either. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this

[racket-users] Typed Racket unsafe-provide with contract?

2016-04-22 Thread Jack Firth
I'm writing some Typed Racket code that works with syntax objects, which currently can't be converted to contracts since syntax chaperones aren't a thing. As a result, if I want untyped racket users to use my library, I have to `unsafe-provide` functions in my module. However, all of my

[racket-users] Re: Order of argument conventions, or ... conventions of argument ordering

2016-04-22 Thread Jack Firth
On Friday, April 22, 2016 at 10:40:01 AM UTC-7, Ronie Uliana wrote: > I like a lot this advice from Haskell: > > "... in Haskell it is not possible to alter objects, but there are many > functions which return a somehow altered input object. This object should be > the last parameter because

[racket-users] Re: scribble output redirection

2016-04-22 Thread Jack Firth
How are you running Scribble? The command line `scribble` program, DrRacket's scribble plugin, or through `raco setup`? -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an

[racket-users] Question about syntax properties and expansion

2016-04-21 Thread Jack Firth
The documentation for syntax properties states that if a macro sets a syntax property during expansion then instead of the expanded syntax having only the set value, it has a cons tree containing that value and any previous values set for that same property. As I understand it, this means it's

Re: [racket-users] Question about syntax properties and expansion

2016-04-21 Thread Jack Firth
> In the same way that properties can now be attached as preserved or > not, we could and an option for specifying whether properties are are > propagated/merged or not. If it's useful, we could even allow a > combining function to be associated with with either a property value > or a property

[racket-users] How to write a #%module-begin that inspects a syntax property post expansion?

2016-05-08 Thread Jack Firth
I'm writing a series of macros that attach metadata using syntax properties during expansion, and I'm attempting to write a #lang whose module-begin form expands the module and then inspects the metadata attached. The problem I'm getting is that local-expand seems to not "expand enough" - it

[racket-users] Re: Running racket on a #lang-less module-less file?

2016-05-06 Thread Jack Firth
William's remark is spot on about my use-case. There exists a language that wasn't initially designed with racket in mind, but could easily be a racket #lang. To interop with code already written in this language, I wanted an easy way to run files that don't have the #lang line. If I were

[racket-users] Running racket on a #lang-less module-less file?

2016-05-05 Thread Jack Firth
Suppose I have a file in some custom language, like #lang foo, but it omits the #lang foo line. Is there a way I can run the racket command line program in a way where it says "treat this file as if it starts with the line #lang foo"? I'm having trouble parsing the "Running Racket or Gracket"

Re: [racket-users] Running racket on a #lang-less module-less file?

2016-05-05 Thread Jack Firth
On Thursday, May 5, 2016 at 5:39:44 PM UTC-7, Matthew Flatt wrote: > At Thu, 5 May 2016 17:32:20 -0700 (PDT), Jack Firth wrote: > > Does that evaluate the file as if it were entered in a REPL? > > Yes. What if I don't want REPL semantics, but I want behavior identical to if

Re: [racket-users] Running racket on a #lang-less module-less file?

2016-05-05 Thread Jack Firth
On Thursday, May 5, 2016 at 5:28:06 PM UTC-7, Matthew Flatt wrote: > At Thu, 5 May 2016 17:14:57 -0700 (PDT), Jack Firth wrote: > > Suppose I have a file in some custom language, like #lang foo, but it omits > > the #lang foo line. Is there a way I can run the racket command li

Re: [racket-users] Macros that use with-handlers

2016-07-17 Thread Jack Firth
On Saturday, July 16, 2016 at 7:06:10 PM UTC-4, David K. Storrs wrote: > So, if one should prefer functions, what is a good place to use > macros? When people talk about why LISP/Scheme/Racket are the most > powerful languages, they inevitably mention macros and continuations. > What is a good

[racket-users] Re: Racket Docker images from Alpine

2016-07-13 Thread Jack Firth
On Tuesday, July 12, 2016 at 8:20:55 PM UTC-7, m4burns wrote: > Hi all, > > I remember this topic came up on the list a while back. I've made a > Docker image of the latest Racket from alpine 3.3 with just musl libc. I > had to monkey patch some Racket internals to get this working, so it >

Re: [racket-users] TR could be even more spectacularly awesome:

2016-07-13 Thread Jack Firth
On Tuesday, July 12, 2016 at 2:36:24 PM UTC-7, Sam Tobin-Hochstadt wrote: > Could this be an API like the one for tooltips? IOW, some sort of general > warning with a message and a syntax location? I'd just like to interject quickly and say that's what I'm working on for RacketCon :) -- You

[racket-users] Re-using an identifier as a submodule name?

2016-07-14 Thread Jack Firth
I've got a macro that extends function definition by letting the user rebind some identifiers with different values, which are then only available in a certain context. For the sake of simplicity suppose it looks like this: (define/foo (func v ...) #:bind [helper1 expr] #:bind [helper2

[racket-users] Re: Re-using an identifier as a submodule name?

2016-07-14 Thread Jack Firth
On Thursday, July 14, 2016 at 10:28:07 PM UTC-7, mattap...@gmail.com wrote: > On Friday, July 15, 2016 at 2:22:50 PM UTC+10, Jack Firth wrote: > > I've got a macro that extends function definition by letting the user > > rebind some identifiers with different values, whic

[racket-users] [ANN] Mock, a test mocking library

2016-07-28 Thread Jack Firth
I've written a library for making test mocks, so that tests can verify they're correctly calling dependencies without really calling them (for example, to avoid IO in unit tests). It's available in the package catalog under the name "mock", and a separate package with RackUnit checks for mocks

Re: [racket-users] Re: Package layout in docs

2017-01-31 Thread Jack Firth
On Tuesday, January 31, 2017 at 11:25:31 AM UTC-8, Neil Van Dyke wrote: > For the benefit of the tightwad people, packages could optionally > include metadata about any docs and tests that can be stripped -- > anything nonessential to "run-only" the package. This metadata could be > used by

[racket-users] Re: Package layout in docs

2017-01-30 Thread Jack Firth
Rather than splitting "core packages" from "community packages", what if we used the package ring system? [1] We could establish a way for the Racket community to bless packages with "ring zero" status, then provide a --catalog argument to Scribble to lookup ring information in when deciding

[racket-users] Re: Package Providing results from another package

2017-01-26 Thread Jack Firth
Usually when this situation arises, the collection is divided as you suggest into a `foo/base` module that has minimal dependencies and a small "kernel" API, while various `foo/X` modules provide things that either are logically not necessary in the base API or may trigger large dependencies.

[racket-users] Re: math/statistics running expected values

2017-01-27 Thread Jack Firth
I don't have enough stats experience to help with the details of your problem, but I'd like to suggest adding a separate package that extends math/statistics. You'll likely have an easier time developing and testing it, and you won't have to worry about adding extra dependencies to the built in

[racket-users] Re: Programming paradigms supported by Racket (according to wikipedia)

2017-02-12 Thread Jack Firth
Somewhat reductionally, anyone can write a Racket library that implements a `#lang` with the semantics of any language on that list, so Racket therefore supports all paradigms. This doesn't really say anything useful. -- You received this message because you are subscribed to the Google Groups

Re: [racket-users] Are types first class values in typed/racket

2017-02-15 Thread Jack Firth
That's not possible in Typed Racket, no. Type checking is after macro expansion so type information doesn't even exist when your macro would expand. However, hope is not lost. There is a new approach to typechecking with macros outlined in the Types as Macros paper by Stephen Chang and Alex

[racket-users] How to adjust an expansion-time parameter in a dynamic-require?

2016-09-02 Thread Jack Firth
I have a module that during its expansion calls a function defined by a parameter. I have a command line tool that would like to read a module path and dynamic-require it with that parameter changed to implement tool-specific behavior. However, (parameterize ([param tool-func])

[racket-users] Re: DrRacket Debugger pause on error?

2016-10-04 Thread Jack Firth
I'm not sure about how to do this with the DrRacket debugger, but you can use `debug-repl`[1] from the `debug` package to basically set a breakpoint that opens a REPL you can use to inspect variables in. This works in both DrRacket and regular command line racket. [1]

Re: [racket-users] Custom command completion?

2016-09-22 Thread Jack Firth
Right, but shell completion varies by shell implementaiton so I was hoping that raco would have some built-in completion script that racket installs, and that script would dispatch to some racket code that implements custom completion for a particular command I'd like to stick something like

[racket-users] Custom command completion?

2016-09-22 Thread Jack Firth
If I have a `raco` command that I want to add command completion too, how can I do that? Ideally I'm looking for some way to tell raco to dispatch to a particular function whenever shell completion is requested for any uses of my raco command. If there is no way to do this right now, what would

[racket-users] Re: moment->date or moment ... -> ... epoch-seconds

2016-09-22 Thread Jack Firth
On Thursday, September 22, 2016 at 10:55:11 AM UTC-7, Geoffrey Knauth wrote: > I was using Racket's date. Then I found it was creating a local time when I > needed UTC. So I started using moments from (require gregor). Now I'm trying > to figure out how to get either a regular date from a

[racket-users] Re: Help with macros

2016-09-21 Thread Jack Firth
Your `syntax-rules` macro-defined macro uses the name "b", but that name is already bound by the `syntax-case` step of `define-primitive`. So your expansion looks like this: (define-primitive (add a b c d) (print (+ a b c d))) => (begin (define add-property-table (make-hash)) (hash-set!

[racket-users] Re: Sending a file via HTML request.

2016-08-23 Thread Jack Firth
You could base64 encode the file bytes and stick that into a field in the JSON you send. Why not just send the file directly though? For instance, instead of sending this: POST /somewhere Content-Type: application/json { filename: "foo" content:

[racket-users] How to get non-prefab struct values from manually-expanded syntax?

2016-10-03 Thread Jack Firth
So I'm reading a file in as code and expanding it, then looking for values in a certain syntax property that macros in the expanded code attach. This works fine for prefab structs, but I can't seem to get it to work with transparent structs. The issue is that the struct values can be extracted

[racket-users] Re: Convention for package build scripts (that don't really have to be part of the package)?

2016-10-29 Thread Jack Firth
I've thought about this as well, and I think a `-build` or a `-develop` package makes the most sense. As an aside, if you wanted to you could even add some Scribble docs to that package describing the implementation of your library and where important bits of it are. That kind of documentation

Re: [racket-users] Re: cvs-reading ?

2016-10-29 Thread Jack Firth
/; \ > system error: No such file or directory; errno=2 > context...: > standard-module-name-resolver > [1]32658 exit 1 ./test.rkt > > What did I wrong here? > > Cheers > Meino > > Jack Firth <jackhfi...@gmail.com> [16-10-30 06:08]: > &

[racket-users] Re: cvs-reading ?

2016-10-29 Thread Jack Firth
I would recommend adding `info.rkt` files to your projects so that your projects are *themselves* packages. In these info files you can declare what packages you depend on, so rather than manually installing dependencies one at a time globally (and reinstalling when upgrading racket), you

Re: [racket-users] Declaring structs as final?

2016-11-07 Thread Jack Firth
On Monday, November 7, 2016 at 11:19:22 AM UTC-8, David K. Storrs wrote: > Out of curiosity, why do you want this? Some context: https://github.com/jackfirth/lens/issues/290 -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from

[racket-users] Re: Round-tripping binary data through the web server

2016-11-08 Thread Jack Firth
HTTP headers are ASCII characters only (more accurately, ISO-8859-1 - slight differences from ASCII). So your protobuf message stored in the header may get bytes above the 127-character range of ASCII mangled. There's a few other issues here: 1. You're including the protobuf serialization in a

[racket-users] Re: find-seconds daylight saving

2016-11-10 Thread Jack Firth
This thread truly terrifies me when I think of any code I ever wrote that worked with dates and times. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[racket-users] Re: opinions on YAML as communication tool

2016-10-21 Thread Jack Firth
If you'd still like to use yaml, I would like to quietly point out that each of the following is a valid boolean value in yaml: - true - false - yes - no - y - n - True - False - TRUE - FALSE - on - off - YES - NO ... but it's not strictly case-insensitive, as yES is parsed as a string -- You

[racket-users] Re: date->seconds complaining about a supposedly non-existent date

2016-10-20 Thread Jack Firth
There's also the Gregor package (https://docs.racket-lang.org/gregor/index.html?q=gregor), which gives a much more comprehensive interface to dates and times. In particular, Gregor allows you to specify an "offset resolver" for these sorts of time-holes. -- You received this message because

[racket-users] Re: If a thunk is a proc of zero arguments, what is a proc of one argument?

2016-11-13 Thread Jack Firth
I'm assuming you intend to *use* the argument, in which case this is a trickier macro to write than `thunk` because you have to make sure the macro respects scope properly. If you wanted a function that accepts one argument and ignores it, you can use `const`. Otherwise, you can implement a

[racket-users] Re: Logging and stdout in web-server

2016-11-11 Thread Jack Firth
You may need to call `(flush-output)` after printing to ensure the buffer is flushed. The library racket/place/distributed provides some convenience wrappers like printf/f and displayln/f which print and immediately flush the output port. -- You received this message because you are

[racket-users] Re: Contracts for functions that take only a rest arg

2016-11-01 Thread Jack Firth
As an aside, I've written (define (rest-> arg result) (->* () #:rest (listof arg) result)) enough times that it'd be nice if it was either in the racket/contract library or a sugar/contract lib on the package server. -- You received this message because you are subscribed to the Google Groups

[racket-users] [ANN] New packages: compose-app and retry

2017-01-10 Thread Jack Firth
I've added two new packages to the package catalog. The first, `compose-app`, provides a simple #%app macro for composing single-argument functions together: > (require compose-app) > (map (add1 .. string->number) (list "1" "2" "3")) (list 2 3 4) Optionally, you can use the package with

[racket-users] Re: minimal vs full racket performance issues

2017-03-16 Thread Jack Firth
On Thursday, March 16, 2017 at 3:25:34 PM UTC-7, Dan Liebgold wrote: > Is there a way to do minimal installs of packages? I imagine skipping any > gui elements would cut down the dependencies quite a bit. You can install a package in binary form with `raco pkg install --binary foo`, which

[racket-users] Re: low-friction app extensibility in racket

2017-07-06 Thread Jack Firth
On Thursday, July 6, 2017 at 2:53:43 AM UTC-7, Neil Van Dyke wrote: > * Pretty similar alternative: user has a Racket file "my-foo", which is > the immediate program the user runs. This file does a `(require foo)`, > as well as a `(start-foo #:pref1 x #:pref2 y ...)`. You may be interested in

[racket-users] [ANN] New package: disposable

2017-07-21 Thread Jack Firth
I recently published `disposable`, an experimental package for safely handling external resources. Features: - representation of a "disposable", a producer of values with external resources that must be disposed - safe handling of disposables for multiple usage patterns, including: - for a

Re: [racket-users] [ANN] MessagePack implementation for Racke

2017-07-24 Thread Jack Firth
> Just to make sure I understood correctly: ‘msgpack’ is the umbrella module > that users import, ‘msgpack/test/pack’ (and ‘unpack’) are the test modules > that will be run for testing only. How about the directory structure? I like > to keep all source files in a source directory (my original

[racket-users] Re: Best way to write run-once-and-cache functions?

2017-04-26 Thread Jack Firth
A `define/delay` macro for this might be a good addition to `racket/promise`: (define-simple-macro (define/delay id:id expr:expr) (begin (define p (delay expr)) (define (id) (force p (define/delay conf (with-input-from-file "db.conf" read-json)) (conf) ;; forces promise -- You

  1   2   >