Re: [racket-users] [macro help] How can I render a parenthesized set of elements optional?

2019-02-15 Thread Alexis King
Jon is right. Here’s an explanation why. Think of `...` as a postfix operator. It repeats what comes before it a certain number of times. In order for `...` to know how many times to repeat the previous head template, it looks inside the head template for any attributes bound at the appropriate

[racket-users] [ANN] scribble/minted, code highlighting via pygmentize

2019-02-15 Thread William J. Bowman
In case anyone else needs this and wasn't looking at that other thread with an unrelated subject: I made a little scribble library to do code highlighting through pygmentize in a way that supports multiple backend renderers. https://github.com/wilbowma/scribble-minted Supports PDF, LaTeX, and H

Re: [racket-users] Scribble document extending a renderer with a new mixin

2019-02-15 Thread William J. Bowman
I was missing something: a bug in my code. FYI, I got this working if anyone wants an example of how to patch Scribble's current render mixin. https://github.com/wilbowma/scribble-minted -- William J. Bowman On Fri, Feb 15, 2019 at 05:48:37PM -0800, William J. Bowman wrote: > I've created a scr

Re: [racket-users] [macro help] How can I render a parenthesized set of elements optional?

2019-02-15 Thread Jon Zeppieri
On Fri, Feb 15, 2019 at 11:50 PM David Storrs wrote: > > #lang racket > (require (for-syntax racket/syntax syntax/parse)) > > (define-syntax (struct++ stx) > (syntax-parse stx > [(_ name:id (field:id ...) (~optional (rule:expr ...)) opt ...) > #'(begin (struct name (field ...) opt ...)

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] [macro help] How can I render a parenthesized set of elements optional?

2019-02-15 Thread David Storrs
I'm twiddling with struct-plus-plus, adding declarative rules, and ~? isn't doing what I expect. I expect that: (~? rule) ... is equivalent to (~? rule (~@)) and means "If `rule` matched something, insert it here. Do this for each item that `rule` matched. If `rule` did not match anything, p

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

2019-02-15 Thread Matthias Felleisen
> On Feb 15, 2019, at 11:05 PM, jackhfi...@gmail.com wrote: > > 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 >

[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] Re: Autocomplete from a list

2019-02-15 Thread Greg Hendershott
If the user will choose very frequently (and you want the fastest UX), and the choices in the database don't change very frequently: It might be worth experimenting with caching the choices in memory. For auto-complete I imagine something like a trie, or whatever the latest hotness might be. The m

[racket-users] Scribble document extending a renderer with a new mixin

2019-02-15 Thread William J. Bowman
I've created a scribble render mixin to call out to pygmentize for typesetting certain code elements with a certain style. However, it seems to me that I can't get scribble to use the mixin without modifying scribble/run.rkt. I've tried (via rackunit's require/expose) modifying current-render-mixin

Re: [racket-users] Communicating the purpose of Racket (was: hackernews)

2019-02-15 Thread David Storrs
It looks pretty appealing to me as well. Clear, concise, and oriented around pain points that a common developer would have. On Fri, Feb 15, 2019 at 11:55 AM wrote: > I will throw out the Julia homepage (https://www.julialang.org) as a good > example of language marketing. Perhaps, though, I fi

Re: [racket-users] Reusing scribble/examples for other languages with external interpreters (Coq)?

2019-02-15 Thread Sorawee Porncharoenwase
Totally! On Fri, Feb 15, 2019 at 10:15 AM William J. Bowman wrote: > Thanks! Looks pretty helpful to me; at the very least I think I can rip > out the > parser and interactive loop. > I've already got something syntax highlighting by calling off to > Pygmentize. > > Might if I reuse some of that

Re: [racket-users] Reusing scribble/examples for other languages with external interpreters (Coq)?

2019-02-15 Thread William J. Bowman
Thanks! Looks pretty helpful to me; at the very least I think I can rip out the parser and interactive loop. I've already got something syntax highlighting by calling off to Pygmentize. Might if I reuse some of that code and put it in a little scribble library? (I don't see a license) -- William

Re: [racket-users] Communicating the purpose of Racket (was: hackernews)

2019-02-15 Thread travis . hinkelman
I will throw out the Julia homepage (https://www.julialang.org) as a good example of language marketing. Perhaps, though, I find the marketing effective because it is largely targeted at people like me. On Tuesday, February 12, 2019 at 1:18:26 PM UTC-8, Nadeem Abdul Hamid wrote: > > Maybe the

Re: [racket-users] Contracts question on structs

2019-02-15 Thread Chris GauthierDickey
Still having trouble though, can't get struct/dc to work in the way I'd like. I tried to simplify my example: (define Result/c (struct/dc Result (a number?) (b boolean?) ; in other words, if a is 0, then b must be ; false or the contract is bro

Re: [racket-users] Contracts question on structs

2019-02-15 Thread Chris GauthierDickey
I believe it should be since bst/c is supposed to be a contract. Also I noticed the docs at https://docs.racket-lang.org/reference/data-structure-contracts.html show a similar example: ; bst-between : number number -> contract ; builds a contract for binary search trees ; whose values are between

[racket-users] Racket News - Issue 2

2019-02-15 Thread 'Paulo Matos' via Racket Users
I have just published Issue 2 at http://racket-news.com/2019/02/racket-news-issue-2.html I would have loved to send a text version to the mailing list but with code and images to render I haven't found a way to do this properly yet. I have tried scribble --text and pandoc but both had shortcomin