Re: [racket-users] change DrRacket syntax coloring per-source rather than per-lang?

2015-11-27 Thread mb
Sorry for the noob question, but broadly, how does one affect the behavior of 
the syntax colorer (and thereby the lexer) from the #lang (if not through 
`get-info`)?


On Friday, November 27, 2015 at 8:37:47 AM UTC-8, Robby Findler wrote:
> I think that you have to make the syntax colorer discover which is the
> @ character in the same way "#lang pollen" discovers it and then pass
> that along to the scribble-inside-lexer. (This may require changing
> scribble-inside-lexer to be more flexible in when it accepts the
> character.) Lexers have a way to track context information (via the
> "mode" argument and the last result) and so that can be extended to
> track whether or not the character has been seen yet and, if it has,
> what it is.
> 
> Robby
> 
> 
> On Fri, Nov 27, 2015 at 10:09 AM, MB wrote:
> > In `#lang pollen`, which uses a variant of at-expressions, you can change 
> > the command character on a per-source-file basis, so you can say `◊(+ 1 1)` 
> > or `∆(+ 1 1)` or `@(+ 1 1)` ...
> >
> > I'm trying to figure out if I can bubble this up to DrRacket for syntax 
> > coloring. I see two wrinkles:
> >
> > 1) For syntax-coloring purposes, the command character is set in the 
> > `get-info` function for the #lang, which in pollen looks like this:
> >
> > (define (get-info in mod line col pos)
> >   (λ (key default)
> > (case key
> >   [(color-lexer)
> >(define make-scribble-inside-lexer2
> >  (dynamic-require 'syntax-color/scribble-lexer 
> > 'make-scribble-inside-lexer (λ () #f)))
> >(cond [make-scribble-inside-lexer2
> >   (make-scribble-inside-lexer2 #:command-char #\◊)]
> >  [else default])]
> >   [else default])))
> >
> >
> > I could set the command character properly if I had access to the path of 
> > the source file. But IIUC DrRacket invokes the `get-info` for a #lang on a 
> > "global" basis, i.e., before it considers any source-specific information.
> >
> >
> > 2) DrRacket seems to cache the result of `get-info` for a whole session. So 
> > even if I could set the command character correctly for the first source 
> > file, it wouldn't change if I had multiple source files open with multiple 
> > command characters (in different tabs or windows).

-- 
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 https://groups.google.com/d/optout.


[racket-users] change DrRacket syntax coloring per-source rather than per-lang?

2015-11-27 Thread mb
In `#lang pollen`, which uses a variant of at-expressions, you can change the 
command character on a per-source-file basis, so you can say `◊(+ 1 1)` or `∆(+ 
1 1)` or `@(+ 1 1)` ...

I'm trying to figure out if I can bubble this up to DrRacket for syntax 
coloring. I see two wrinkles:

1) For syntax-coloring purposes, the command character is set in the `get-info` 
function for the #lang, which in pollen looks like this:

(define (get-info in mod line col pos)
  (λ (key default)
(case key
  [(color-lexer)
   (define make-scribble-inside-lexer2
 (dynamic-require 'syntax-color/scribble-lexer 
'make-scribble-inside-lexer (λ () #f)))
   (cond [make-scribble-inside-lexer2
  (make-scribble-inside-lexer2 #:command-char #\◊)]
 [else default])]
  [else default])))


I could set the command character properly if I had access to the path of the 
source file. But IIUC DrRacket invokes the `get-info` for a #lang on a "global" 
basis, i.e., before it considers any source-specific information.


2) DrRacket seems to cache the result of `get-info` for a whole session. So 
even if I could set the command character correctly for the first source file, 
it wouldn't change if I had multiple source files open with multiple command 
characters (in different tabs or windows).




-- 
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 https://groups.google.com/d/optout.


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

2015-10-08 Thread mb
> Duplication is an uncomfortably common problem in Lispy circles, but 
> fragmentation is never a good thing

To be fair, there are plenty of good reasons why duplication / fragmentation 
would exist, many of them ultimately beneficial to the underlying system. 
Fragmentation is not per se bad. Standardization is not per se good (because it 
imposes its own costs & consequences).

-- 
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 https://groups.google.com/d/optout.


Re: [racket-users] http connection errors on pkg-build

2015-08-01 Thread mb
I don't know if that's a separate error. I've assumed that it's a side effect 
of the build failing (= no docs end up where they're expected to be)


On Saturday, August 1, 2015 at 9:02:43 AM UTC-7, Andrew Gwozdziewycz wrote:
> Possibly related? http://pkg-build.racket-lang.org/doc/pollen fails with a 
> 403 forbidden. Maybe some s3 permissions changed?
> 
> 
> On August 1, 2015 8:54:11 AM PDT, Matthew Butterick  wrote:
> For the last couple of days my pollen builds have failed with this 
> "connection failed" error. I don't see any other packages failing to download 
> from GitHub, suggesting it's my fault. OTOH the supposedly defective URL 
> works fine, so I'm not sure how to make the build server happier.
> 
> 
> Downloading 
> https://github.com/mbutterick/pollen/tarball/c62bdbbe7233c5190628731725ba9169bc2cb067
> tcp-connect: connection failed
>   detail: host not found
>   address: github.com
>   port number: 443
>   step: 1
>   system error: Name or service not known; errno=-2
> 
> 
> 
> 
> 
> 
> 
> -- 
> 
> Sent from space.

-- 
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 https://groups.google.com/d/optout.