Re: [racket-users] Is it necessary to print after expansion?

2019-04-09 Thread jackhfirth
> > Still, because I'm writing for people new to Racket, I think it's wiser to > promote a habit of explicitly calling an output function. Why? Because as > you move code around, you may be surprised when something stops printing > (because it's no longer at the top level). For instance, new Ra

[racket-users] Interning custom types?

2019-03-23 Thread jackhfirth
If I wanted to make my own interned data type, how hard would that be? I have a datatype representing an immutable sorted set of keywords and I want to guarantee that total memory use for these sets depends only on the number of unique combinations of keywords created by a program. -- You rece

Re: [racket-users] Re: Pretty display of tabular data?

2019-03-16 Thread jackhfirth
Hooray! Now we're up to 7 tagged packages (that was fast!) On Saturday, March 16, 2019 at 12:13:38 PM UTC-7, johnbclements wrote: > > Yep, excellent idea. I’ve added the ’tabular’ tag to csv-writing. > > John > > > On Mar 15, 2019, at 3:24

Re: [racket-users] Re: Pretty display of tabular data?

2019-03-15 Thread jackhfirth
I think we should all work towards making our existing code in this area more discoverable, so we can get a better sense of what libraries for working with tables exist in the wild. To those of you who own Racket packages that provide any functionality related to data tables: I recommend adding

[racket-users] Re: Pretty display of tabular data?

2019-03-13 Thread jackhfirth
I've wanted this too, and got the sense that working with `snip%` instead of `gen:custom-write` was 1) the way to go and 2) very difficult. Are you planning on using this in some open source code you have right now in a github repo or something similar? I'd like to bookmark it. On Wednesday, Ma

[racket-users] How to document modules that reprovide other modules?

2019-03-02 Thread jackhfirth
If I have two modules `foo` and `foo/extra-thing`, and `foo` requires and re-provides all the exports of `foo/extra-thing`, how do I correctly document that fact with `defmodule` and `declare-exporting`? The documentation for those two scribble forms doesn't include examples, the grammars for t

Re: [racket-users] Struct properties and recursion

2019-03-01 Thread jackhfirth
Following up on this for anyone interested; I made a small wrapper library ( rebellion/struct-descriptor ) around make-struct-type. You may find it interesting if you've created lots of struct types that all had to implement the sam

Re: [racket-users] how to use union types

2019-02-28 Thread jackhfirth
There is, but it's called "wrap your data in a struct". The type checker doesn't know that serialization guarantees your schema, and you haven't proved that *only* previously-serialized data will be constructed. In order to represent this knowledge with types, you can create a struct wrapper in

Re: [racket-users] how to use union types

2019-02-25 Thread jackhfirth
A JSExpr is one of a couple of things: - A list - A hash with symbol keys - A number - A string - A boolean - Null The (andmap string?) approach implicitly assumes you're giving it a list. But it might be something else instead, so you want this: (and (list? js) (andmap string? js)) On Monday,

[racket-users] Use cases for tables and records

2019-02-21 Thread jackhfirth
Hi folks! I'm looking for use cases for a few small data structure libraries I'm working on: - Records , which are dictionaries mapping keywords to values. Keys must be keywords, which allows for more efficient behavior in various cases and s

Re: [racket-users] Running raco setup from within DrRacket?

2019-02-15 Thread jackhfirth
Using setup/setup works partially, but it doesn't seem to support package dependency checking (and the #:pkgs keyword argument isn't documented). I can't seem to find any programmatic alternative to the --check-pkg-deps and --unused-pkg-deps flags. On Friday, February 15, 2019 at 8:35:17 PM UTC

[racket-users] Running raco setup from within DrRacket?

2019-02-15 Thread jackhfirth
Whenever I change code in my package I switch over to the terminal and recompile it with `raco setup`. This is slightly tedious and I’d like to be able to do this from within DrRacket. But I’m not sure how to translate the command `raco setup --doc-index --check-pkg-deps --tidy --unused-pkg-deps

Re: [racket-users] struct-info

2019-02-12 Thread jackhfirth
> > This is nice for defining abstract types, but it can be pretty >> inconvenient for defining plain old aggregated data types that just have a >> bundle of fields. When defining those types as structs, consider using the >> #:transparent option. This means "use no inspector at all" (roughly)

Re: [racket-users] struct-info

2019-02-12 Thread jackhfirth
> > Thank you for the explanation. Can I ask why the heck it works this > way? This seems to be explicitly designed for maximal surprise and > minimal usefulness. > It works that way so that, by default, modules can't inspect, modify, or otherwise muck around with structs defined by other m

Re: [racket-users] Collections and data structures wishlist?

2019-01-19 Thread jackhfirth
On Friday, January 18, 2019 at 11:50:48 PM UTC-8, Matthias Felleisen wrote: > > > On Jan 18, 2019, at 10:22 PM, jackh...@gmail.com wrote: > > > - A separation between using lists as homogeneous collections and using > lists as fixed-size tuples. So there'd be a separate `tuple?` data type > that

[racket-users] Collections and data structures wishlist?

2019-01-18 Thread jackhfirth
When it comes to collections and data structures, what would you all like to see in Racket2? New APIs? Changes to existing APIs? Whole new paradigms? Something else? I've got my own wishlist and maybe someday I'll implement a few things on it as packages, but I'm curious what everyone else thin