Re: [racket-users] Re: ask a pict its colour?

2020-04-20 Thread Spencer Florence
You could use pict/convert to make a wrapper that remembers the color:

```
#lang racket
(require pict pict/convert)
(struct pict+color (pict color)
  #:property prop:pict-convertible
  (lambda (x) (pict+color-pict x)))

(define (my-colorize p c)
  (pict+color
   (colorize p c)
   c))

(define (get-color p)
  (and
   (pict+color? p)
   (pict+color-color p)))
  ```

This would be a little unreliable, as only the direct result of
`my-colorize` would have a retrievable color, but it might work for your
purposes.

--spencer

On Sat, Apr 18, 2020 at 9:34 PM Robby Findler 
wrote:

> I basically agree with Alex, as the internal structures of pict don't
> really keep information in that way, but a "best effort" might be to
> draw it into a bitmap and then use the bitmap to find the average
> color or the most common color (perhaps with some error bounds on what
> colors count as "the same") or something like that.
>
> Robby
>
> On Sat, Apr 18, 2020 at 6:49 PM Alex Harsanyi 
> wrote:
> >
> >
> > I don't think such a procedure can be written. at least not for the
> general case.
> >
> > First, the color of `(filled-rectangle 30 30)` is not black, but
> whatever color was installed in the drawing context when the filled
> rectangle was rendered.  You can change it to red using:
> >
> > (colorize (filled-rectangle 20 20) "red")
> >
> > Even if you could inspect the colorize pict, it would still not be
> sufficient for a general `get-color` function.  Users can write their own
> pict constructors using dc:
> >
> >
> > (define colors (list "red" "green" "blue" "yellow"))
> >
> > (define (my-red-colorize other-pict)
> >   (dc (lambda (dc dx dy)
> >
> > (define color (list-ref colors (random (length colors
> >
> > (define old-pen (send dc get-pen))
> > (send dc set-pen (new pen% [width 1] [color color]))
> >
> > (draw-pict other-pict dc dx dy)
> >
> > (send dc set-pen old-pen))
> >   (pict-width other-pict)
> >   (pict-height other-pict)))
> >
> > And a call like `(my-red-colorize (filled-rectangle 20 20))` will only
> result in a red rectangle about 25% of the time.
> >
> > Even if you want to ignore cases like the above, what should `get-color`
> return for the picture below?
> >
> > (hc-append (colorize (filled-rectangle 20 20) "red") (colorize
> (filled-rectangle 20 20) "blue"))
> >
> >
> > Alex.
> >
> >
> > On Saturday, April 18, 2020 at 8:00:12 PM UTC+8, Raoul Schorer wrote:
> >>
> >> Hi,
> >>
> >> Using the 'pict' library, I could not find predicates regarding color
> in the doc.
> >> Is there something like
> >>
> >> (get-color (filled-rectangle 30 30)) --> "black"
> >>
> >> somewhere?
> >> If not, how can I make a reliable color predicate?
> >>
> >> Thanks,
> >> Raoul
> >
> > --
> > 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.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/d3fa9021-63af-4129-bfb6-a82e219cfcf0%40googlegroups.com
> .
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAL3TdONPB16S1srT1%3Dz0ZPM52%3DZh624hrq5zOc7C4oerXqgaCA%40mail.gmail.com
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAF4wvDzH-AK40WjJrnhFKDAiJaV5fQrCV0othqQj-R%3Di7S1PxQ%40mail.gmail.com.


Re: [racket-users] cover package?

2020-02-26 Thread Spencer Florence
Moral of this story: the pkg-build server configuration can have bugs in
it. Therefore, if you don't test it, it will have bugs in it

--spencer

On Wed, Feb 26, 2020 at 3:28 PM Stephen Foster 
wrote:

> On further investigation, cover just seems to be broken, older versions
> install without errors.  I'll open a ticket on that repo.
>
> On Wed, Feb 26, 2020 at 1:14 PM Stephen Foster 
> wrote:
>
>> I have a Dockerized racket app that has (today, I think) started failing
>> with errors related to the "cover" package.  I don't use cover -- though I
>> assume one of my dependencies does.  Adding "cover" explicitly to my
>> info.rkt file doesn't fix the issue.
>>
>> What might be going wrong here?  And how can I track down what depends on
>> this?
>>
>> open-input-file: cannot open module file
>>   module path: cover
>>   path: /root/.racket/7.5/pkgs/cover/main.rkt
>>   system error: no such file or directory; rktio_err=3
>>   compilation context...:
>>/root/.racket/7.5/pkgs/cover/cover-lib/cover/raco.rkt
>>   context...:
>>maybe-raise-missing-module
>>default-load-handler
>>standard-module-name-resolver
>>module-path-index-resolve
>>perform-require!78
>>for-loop
>>finish
>>[repeats 10 more times]
>>pass-1-and-2-loop
>>module-begin-k
>>expand-module16
>>expand-capturing-lifts
>>temp118_0
>>temp91_0
>>compile15
>>/usr/share/racket/collects/compiler/private/cm-minimal.rkt:428:0:
>> compile-zo*66
>>...
>>
>>
>> standard-module-name-resolver: collection not found
>>   for module path: cover/private/shared
>>   collection: "cover/private"
>>   in collection directories:
>>/root/.racket/7.5/collects
>>/usr/share/racket/collects
>>... [217 additional linked and package directories]
>>sub-collection: "private"
>>   in parent directories:
>>/root/.racket/7.5/pkgs/cover
>>   compilation context...:
>>/root/.racket/7.5/pkgs/cover/cover-test/format-utils.rkt
>>   context...:
>>show-collection-err
>>standard-module-name-resolver
>>module-path-index-resolve
>>perform-require!78
>>for-loop
>>finish
>>[repeats 13 more times]
>>pass-1-and-2-loop
>>module-begin-k
>>expand-module16
>>expand-capturing-lifts
>>temp118_0
>>temp91_0
>>compile15
>>/usr/share/racket/collects/compiler/private/cm-minimal.rkt:428:0:
>> compile-zo*66
>>/usr/share/racket/collects/compiler/private/cm-minimal.rkt:731:15
>>...
>>
>>
>> standard-module-name-resolver: collection not found
>>   for module path: cover/private/shared
>>   collection: "cover/private"
>>   in collection directories:
>>/root/.racket/7.5/collects
>>/usr/share/racket/collects
>>... [217 additional linked and package directories]
>>sub-collection: "private"
>>   in parent directories:
>>/root/.racket/7.5/pkgs/cover
>>   compilation context...:
>>/root/.racket/7.5/pkgs/cover/cover-test/format-utils.rkt
>>   context...:
>>show-collection-err
>>standard-module-name-resolver
>>module-path-index-resolve
>>perform-require!78
>>for-loop
>>finish
>>[repeats 13 more times]
>>pass-1-and-2-loop
>>module-begin-k
>>expand-module16
>>expand-capturing-lifts
>>temp118_0
>>temp91_0
>>compile15
>>/usr/share/racket/collects/compiler/private/cm-minimal.rkt:428:0:
>> compile-zo*66
>>/usr/share/racket/collects/compiler/private/cm-minimal.rkt:731:15
>>...
>>
>>
>> etc.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Racket Users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/racket-users/X7O4bUAnqxU/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/5b09c421-621c-4485-91eb-81a2ab6249d4%40googlegroups.com
>> 
>> .
>>
>
>
> --
>
>
> Stephen Foster
> ThoughtSTEM Co-Founder
> 318-792-2035
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CA%2BzSu29hL3BOa7Ez-Om29RNr9B-E19M%3Dr1TX3KV-MMB8AL%3DV%2Bg%40mail.gmail.com
> 
> .
>

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

Re: [racket-users] pict polygons

2019-12-17 Thread Spencer Florence
2htdp/image works with pict directly (they are pict-convertible?, and all
pict functions accept those).

If that does work for whatever reason, it shouldnt be terrible to write
that function using ‘dc’ and ‘dc-path%’, and it would make a great PR to
‘pict’!

—spencer

On Tue, Dec 17, 2019 at 8:15 AM Hendrik Boom  wrote:

> I've been looking through pict documentation again, and failed to find
> a way to draw arbitrary polygons.
>
> (at the moment I just want a triangle, but I couldn't even find
> that)
>
> There are triangles in the image.rkt from 2htdp/image, but that seems to
> use
> different data types from pict.
>
> Given the variety of polygons available in pict (such as filled-in
> areas) I would find it surprising if there were no such functionality,
>
> -- hendrik
>
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/20191217141452.g27usl46rwn556re%40topoi.pooq.com
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAF4wvDxWjFLvSNon8D2U9FTQHpVc8j5q-6%2BXhJCH3118539xYw%40mail.gmail.com.


Re: [racket-users] Re: typo in manual

2019-11-25 Thread Spencer Florence
Not the first typo this library has had...

I've pushed a repair, thanks for the report!

--spf

On Fri, Nov 22, 2019 at 11:47 AM 'Joel Dueck' via Racket Users <
racket-users@googlegroups.com> wrote:

> Documentation for individual packages is maintained by the package authors.
>
> Clicking on the "package" link at the top brings you to
> https://pkgs.racket-lang.org/package/colors which says the Git repo is at
> https://github.com/florence/colors/tree/master/scribblings
>
> I can submit a pull request there, unless you would prefer to.
>
> On Friday, November 22, 2019 at 10:39:34 AM UTC-6, Hendrik Boom wrote:
>>
>> In https://docs.racket-lang.org/colors/index.html
>> section 4 presents a function set-brigthness
>> and then proceeds to discuss how it affects brighness
>>
>> Perhaps the function name and the discussion should involve brightness
>> instead.
>>
>> -- hendrik
>>
>> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/b5dcbaa8-c3ad-47a8-bc54-4c48171d73ce%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAF4wvDzLR_z5Aah2kq38OzyR5sqZENXjj3F8UtecjWRd5cxJBw%40mail.gmail.com.


Re: [racket-users] project idea: drracket notebook mode

2018-12-27 Thread Spencer Florence
One exists:

https://github.com/rmculpepper/iracket

On Thu, Dec 27, 2018, 12:53 AM Andrew Gwozdziewycz  It seems like the better bang for buck might be implementing a Jupyter
> kernel, and leveraging that ecosystem.
>
> https://github.com/jupyter/jupyter/wiki/Jupyter-kernels
>
> On Dec 20, 2018, at 02:46, Neil Van Dyke  wrote:
>
> If anyone is looking to avoid relatives over the winter holiday season,
> here's an idea for a big feature to add to DrRacket (which I really wish I
> could do myself right now)...
>
> If you've not seen a "notebook" interface, like in Jupyter Notebook and
> some other data science-oriented tools, one way to look at it is like a
> literate programming REPL that can be edited, stored to a file, and
> loaded.  You can also share these notebooks with others, or generate
> formats like HTML or Markdown (such as for blog posts).
>
> The notebook is a document that's a sequence of text cells and code cells,
> and the code cells include the output (e.g., expression results, displayed
> plots) from the last time the code cell was evaluated (if it was).  Each
> code cell also displays a small serial number that indicates in what order
> it was last evaluated (if it has been), which is not necessarily the
> top-to-bottom order of the document while you're working with it.  Of
> course, you can clear this code evaluation and output at any time, and
> cause all the code cells to be evaluated in-order.
>
> IIRC, DrRacket emphasizes the Definitions window over the Interactions
> window (aka REPL), to reduce confusion for students.  I think the confusion
> level of the Notebook interface is somewhere between that of Definitions
> window and a REPL.  So the notebook interface might not be good for new
> students, unless they're already comfortable with the notebook interface
> from other classes.
>
> Implementation-wise... the people here who built DrRacket can correct me
> or say more about this, but it seems DrRacket implementation might already
> include most of the difficult work of implementing a notebook interface.
> The evaluation engine is there, and there's UI for snips in the Interaction
> window, and UI for embedding blocks of other formats in the Definitions
> window.  Maybe combine/adapt that in a new Notebook window, or implement
> this as features of the Definitions window.  Then you can decide whether to
> also implement the JSON save format of Jupyter Notebook, for possible later
> interoperation.  And other things after that, like in-buffer Markdown or
> Scribble rendering of text cells.
>
> --
> 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.
>
> --
> 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.
>

-- 
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] Why are hash and make-hash not symmetric?

2016-12-07 Thread Spencer Florence
For symmetry there is "make-immutable-hash", which is like "hash" but has
the interface of "make-hash". (I don't know why "hash" is the way it is
though).

--spencer

On Wed, Dec 7, 2016 at 10:49 AM David Storrs  wrote:

> -> (hash 'a 1 'b 2)
> '#hash((a . 1) (b . 2))
>
> -> (make-hash '((a . 1) (b . 2)))
> '#hash((b . 2) (a . 1))
>
> -> (make-hash 'a 1 'b 2)
> (make-hash 'a 1 'b 2)
> ; make-hash: arity mismatch;
> ;  the expected number of arguments does not match the given number
> ;   expected: 0 to 1
> ;   given: 4
> ; [,bt for context]
>
> Why does 'make-hash' not work like 'hash'?  Is it possible that a flag
> could be added that would *make* it work like hash?  Or, alternatively,
> does another function exist that will create a mutable hash but will accept
> N arguments the way 'hash' does?  I understand that it's not very FP to use
> mutation but there are certain problems that are easier that way.
>
> --
> 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.
>

-- 
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] Adding libraries to the student language search

2016-09-25 Thread Spencer Florence
When the current language is one of the student languages searching the
documentation from DrRacket limits the search to a subset libraries
installed. Is there any way to add a new library to this subset?

--Spencer

-- 
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] handin server error

2016-09-07 Thread Spencer Florence
This is a little bit of a hack and weakens the handin server security but
adding the following to the top of your checker file should make this error
go away:

```
 (require handin-server/sandbox)

  (sandbox-path-permissions
   (cons
(list 'read"/")
(sandbox-path-permissions)))
```

--spencer

On Tue, Aug 23, 2016 at 4:15 PM Cameron Swords 
wrote:

> Hi,
>
> I'm trying to set up a handin server for a class this semester, and I'm
> getting the weirdest error message from the client side. Here it is:
>
> submit error: Error in your code --
> file-exists?: `exists' access denied for libobj.so
>
> This seems tied to the fact that the submission file requires another file
> (precisely, it requires 2htdp/image as `(require 2htdp/image)`), and when I
> remove that it works fine (though obviously inhibits the assignment).
>
> Attached are the checker and configuration.
>
> Any help would mean a lot!
>
> Thanks,
> Cameron Swords
>
> --
> 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.
>

-- 
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] using a different "scribble.tex"

2016-03-31 Thread Spencer Florence
Oops, guess I forgot to update this thread.

This commit (
https://github.com/racket/scribble/commit/2881ef290ddfef6b645eaabc997c9bd6fddaa641)
tries to address this problem.

Roughly, you can use `latex-defaults+replacements` to replace
`scribble-load-replace.tex` and override the macros that generate the latex
includes.

--spf


On Thu, Mar 31, 2016 at 2:45 AM Tim Jervis <t...@timjervis.com> wrote:

> Commenting out scribble.tex with an open comment in prefix.tex and closing
> comment in scribble.tex works, to a point. It hides scribble.tex, but it
> also hides any dynamic inclusions such as figure.tex.
>
> I have been trying to use the longtable package in preference to the
> stabular-based  package that Scribble uses for long tables. Unfortunately
> scribble.tex creates some incompatible definitions, which I have been
> trying to work around. My current best option appears to be hacking
> scribble.tex in the Racket source to remove those definitions. It would be
> nice to avoid hacking the source.
>
> On 6 Jan 2016, at 20:53, Matthew Flatt <mfl...@cs.utah.edu> wrote:
>
> There's not currently a simple way to replace "scribble.tex".
>
> Probably you can hack anything by providing an alternate prefix file
> (i.e., replacement for "scribble-prefix.tex"). For example, I bet it
> would be possible to make the prefix file end with an unfinished
> comment, have the comment swallow "scribble.tex" completely, and have a
> style file (i.e., replacement for "scribble-style.tex") end the comment
> and drop in your replacement for "scribble.tex".
>
> At Wed, 06 Jan 2016 20:44:40 +, Spencer Florence wrote:
>
> Hey all,
>
> I'm currently trying to use a custom tex style file with scribble.
> Unfortunately this style file conflicts with the line
> "\usepackage[usenames,dvipsnames]{color}" in the "scribble.tex" file
> include by the scribble to tex compiler.
>
> Is there any way to tell scribble to use a different "scribble.tex"?
>
> --spencer
>
> --
> 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.
>
>
> --
> 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.
>
>
>
> *Tim Jervis*
>
> http://timjervis.com/
>
>

-- 
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] Unicode subscripts in code and scribble

2016-03-10 Thread Spencer Florence
They way I've worked around this in the past is to render the problematic
character as a Pict and then drop that Pict into the scribble document.
Doing that has some problems but it can service if you can't get the
character you want into scribble.

On Thu, Mar 10, 2016, 9:19 AM Vincent St-Amour <
stamo...@eecs.northwestern.edu> wrote:

> I agree, any extension anyone makes should make it into scribble itself.
>
> The scenario I'm concerned about is: user needs an extra character, but
> can't update scribble. Or updating scribble would require updating the
> rest of Racket, which may not be what the user wants.
>
> I guess with the split distribution it's less likely to be a problem,
> though.
>
> Vincent
>
>
>
> On Wed, 09 Mar 2016 19:22:05 -0600,
> Robby Findler wrote:
> >
> > I think any extension is one that all would want (although I am not
> > sure) and so maybe pull requests is a good way to extend it?
> >
> > There is the issue of conflicting imports at the latex level tho, so
> > maybe it should be specifiable at the document level.
> >
> > Robby
> >
> > On Wednesday, March 9, 2016, Vincent St-Amour
> >  wrote:
> >
> > Should that table be user-extensible?
> >
> > Vincent
> >
> >
> > On Wed, 09 Mar 2016 17:11:47 -0600,
> > Robby Findler wrote:
> > >
> > > I think that maybe you're thinking of something fancier than
> > what's
> > > there. It just takes some (small) set of well-known unicode and
> > has
> > > corresponding latex commands. Then, in the latex backend for
> > scribble,
> > > it looks up latex in that table and drops it in, if it finds it.
> > >
> > > Robby
> > >
> > > On Wed, Mar 9, 2016 at 5:09 PM, Leif Andersen
> >  wrote:
> > > >> Scribble has a big table mapping unicode to latex commands.
> > Maybe it
> > > > needs another entry?
> > > >
> > > > Woah, does that actually work? I was under the impression there
> > were
> > > > unicode characters that could combine other unicode characters.
> > > >
> > > > (Although I'd love to be wrong about this. :) )
> > > >
> > > > ~Leif Andersen
> > > >
> > > >
> > > > On Wed, Mar 9, 2016 at 5:55 PM, Robby Findler
> > > >  wrote:
> > > >> Scribble has a big table mapping unicode to latex commands.
> > Maybe it
> > > >> needs another entry?
> > > >>
> > > >> Robby
> > > >>
> > > >>
> > > >> On Wed, Mar 9, 2016 at 4:07 PM, David Van Horn
> >  wrote:
> > > >>> Yes, the problem then is the code font doesn't support that
> > character
> > > >>> so it doesn't show up.
> > > >>>
> > > >>> David
> > > >>>
> > > >>>
> > > >>> On Wed, Mar 9, 2016 at 5:05 PM, Leif Andersen
> >  wrote:
> > >  Have you tried running the outputted tex file in xetex rather
> > than pdflatex?
> > > 
> > >  ~Leif Andersen
> > > 
> > > 
> > >  On Wed, Mar 9, 2016 at 5:03 PM, David Van Horn
> >  wrote:
> > > > I have some source code I'm trying to typeset in a
> > racketblock that
> > > > uses subscript characters like ₀. This breaks when it gets
> > to latex.
> > > > Is there some workaround to generate latex friendly output?
> > > >
> > > > Thanks,
> > > > David
> > > >
> > > > --
> > > > 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.
> > > 
> > >  --
> > >  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.
> > > >>>
> > > >>> --
> > > >>> 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.
> > >
> > > --
> > > 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] using a different "scribble.tex"

2016-01-06 Thread Spencer Florence
Hey all,

I'm currently trying to use a custom tex style file with scribble.
Unfortunately this style file conflicts with the line
"\usepackage[usenames,dvipsnames]{color}" in the "scribble.tex" file
include by the scribble to tex compiler.

Is there any way to tell scribble to use a different "scribble.tex"?

--spencer

-- 
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] Bug with errortrace and begin-for-syntax?

2015-10-10 Thread Spencer Florence
Yup, that looks like a bug. I've created a PR to fix it:
https://github.com/racket/errortrace/pull/4

On Sat, Oct 10, 2015 at 8:51 AM Matthias Felleisen 
wrote:

>
> On Oct 10, 2015, at 12:06 AM, Alex Knauth  wrote:
>
> #lang racket/base
> (require (for-meta 0 racket/base)
> (for-meta 1 racket/base)
> (for-meta 2 racket/base)
> (for-meta 3 racket/base)
> (for-meta 4 racket/base))
> (begin-for-syntax
>  (begin-for-syntax
>(begin-for-syntax
>  )))
>
>
>
> And I thought lambda-lambda-lambda solves all problems :-)
>
> --
> 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.
>

-- 
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] Cover 3.0

2015-09-22 Thread Spencer Florence
Hi all,

We're pleased to announce the release of Cover 3.0!

Cover is an extensible multi-file code coverage tool for Racket. You can
read more about it in our
README at https://github.com/florence/cover .

Breaking Changes:

 * The Coveralls format has been moved into its own package. Anyone using
it will need to change
   their package dependency from `cover` to `cover-coveralls`.  More
details at
   https://github.com/rpless/cover-coveralls .

New features and bug fixes in this version:

 * Support for modules required `for-syntax`.

 * Support for `test-include-paths` and `module-suffixes` in info.rkt, and
regular expressions in
   `test-omit-paths`. These can be used to configure what files Cover does
or does not include in
   its reports.

 * Support for cyclic requires between modules.

 * Improvements on covering macros.

New contributors are always welcome!
If you find bugs, you can open an issue at
https://github.com/florence/cover/issues.
In addition, if there are any new output formats, tools, or services that
you think should be added, open an issue.

Thanks!

--Spencer & Ryan

-- 
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] Macro introduce identifiers in the new expander

2015-07-21 Thread Spencer Florence
That fixed the example I gave, but now this fails:

(let ()
  (def)
  (let ()
(use)))

On Mon, Jul 20, 2015 at 2:50 PM Matthew Flatt mfl...@cs.utah.edu wrote:

 Repair pushed.



  On Jul 20, 2015, at 11:14 AM, Matthew Flatt mfl...@cs.utah.edu wrote:
 
  Thanks for the info. I think it's a bug in the expander, and I have a
  repair, but I think that repair might point to another bug that I'm
  still investigating.
 
  At Mon, 20 Jul 2015 12:56:49 -0400, Alexander D. Knauth wrote:
  I don't really know what's going on, but this might help:
 
  ;; It seems to be introducing the definition correctly, but not the use:
  ;; this works
  (let ()
   (def) ; no difference between (def) and (define id 5)
   id)
 
  ;; this doesn't
  (let ()
   (def)
   (use)) ; but there is a difference between (use) and id
 
  ;; and this doesn't either
  (let ()
   (define id 5)
   (use))
 
  On Jul 20, 2015, at 12:35 PM, Spencer Florence spen...@florence.io
 wrote:
 
  Hello,
 
  I'm trying to update some code to the new expander. The below code
 works on
  6.2 but fails on the new expander with an unbound identifier error.
 
  #lang racket
  (require (for-syntax syntax/parse))
 
  ;; a standard context for identifiers
  (define-for-syntax ctx #'ctx)
 
  ;; create an ID with the context `ctx`, and the current
  ;; expander mark (so that the mark is canceled later),
  ;; and the location loc
  (define-for-syntax (make-id loc)
   (syntax-local-introduce
(datum-syntax ctx 'id loc)))
 
  ;; This introduces a binding
  (define-syntax (def stx)
   (syntax-parse stx
 [(def)
  (with-syntax ([id (make-id #'here)])
#'(define id 5))]))
 
  ;; this attempts to use the binding introduced by `def`
  (define-syntax (use stx)
   (syntax-parse stx
 [(use)
  (with-syntax ([id (make-id #'here)])
#'id)]))
 
  ;; this works
  #;
  (begin
   (def)
   (use))
 
  ;; this fails
  (let ()
   (def)
   (use))
 
  --
  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.
 
  --
  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.
 
  --
  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.
 

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


-- 
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] Macro introduce identifiers in the new expander

2015-07-20 Thread Spencer Florence
Hello,

I'm trying to update some code to the new expander. The below code works on
6.2 but fails on the new expander with an unbound identifier error.

#lang racket
(require (for-syntax syntax/parse))

;; a standard context for identifiers
(define-for-syntax ctx #'ctx)

;; create an ID with the context `ctx`, and the current
;; expander mark (so that the mark is canceled later),
;; and the location loc
(define-for-syntax (make-id loc)
  (syntax-local-introduce
   (datum-syntax ctx 'id loc)))

;; This introduces a binding
(define-syntax (def stx)
  (syntax-parse stx
[(def)
 (with-syntax ([id (make-id #'here)])
   #'(define id 5))]))

;; this attempts to use the binding introduced by `def`
(define-syntax (use stx)
  (syntax-parse stx
[(use)
 (with-syntax ([id (make-id #'here)])
   #'id)]))

;; this works
#;
(begin
  (def)
  (use))

;; this fails
(let ()
  (def)
  (use))

-- 
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] Iteration speed

2015-06-01 Thread Spencer Florence
There is a `#lang typed/racket/base/no-check`

On Mon, Jun 1, 2015 at 9:34 PM John Carmack jo...@oculus.com wrote:

 Is there an option to parse all the type annotations, but not do any of
 the checking? Highly interactive tuning sessions could work without type
 checking, then turn it back on for structural work.



  On Jun 1, 2015, at 9:05 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu
 wrote:
 
  Unfortunately, Typed Racket typechecking is pretty slow, and so the
  times you have there are not out of the ordinary. The most significant
  thing that's slow in Typed Racket is type checking numeric operations,
  because both the numbers themselves and the operations have
  complicated types.
 
  If you can say more about the program in particular, I can maybe
  suggest something that would speed it up, but it's currently a
  combination of expensive-in-principle algorithms and not being
  designed for speed many years ago when I started.
 
  Sam
 
  On Mon, Jun 1, 2015 at 9:06 PM, John Carmack jo...@oculus.com wrote:
  I am working on a little project to remotely drive a VR headset with
 code
  written in Racket as an attempt to make a significantly faster
 development
  environment for certain types of VR apps.  I am worried about what
 appears
  to be the compile speed.
 
 
 
  It takes over three seconds from hitting ctrl-R in DrRacket to
 executing the
  first statement of a 350 line typed racket program.  It only uses:
 
  #lang typed/racket/base
 
  (require racket/tcp)
 
 
 
  That seems to be about twice as slow as a larger untyped racket program
  using a bunch more stuff, but even that isn’t great:
 
  #lang racket
 
  (require 2htdp/universe)
 
  (require 2htdp/image)
 
  (require 2htdp/planetcute)
 
  (require (only-in racket/gui/base play-sound))
 
 
 
  Does Run from DrRacket  have a significant time penalty?
 
  Are there any steps I can take to make typed racket compile faster?
 
  In many cases I don’t care much about the execution speed.
 
 
 
  I would like to think that compiling and running a few hundred lines of
 code
  on a modern desktop system should be essentially instant.
 
 
 
 
 
  --
  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.

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


-- 
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] Cover 2.0

2015-05-30 Thread Spencer Florence
Hi All,

We're pleased to announce the release of Cover 2.0!

Along with the various bug fixes, Cover now:

* Is faster.
* Is completely thread safe.
* Has a new, easier to use, Racket API. This is to support integrating with
IDE's and make new output formats easier to write.

New contributors are always welcome!
If you find bugs, you can open an issue at
https://github.com/florence/cover/issues.
In addition, if there are any new output formats, tools, or services that
you think should be added, open an issue.

Thanks!

--Spencer  Ryan

-- 
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] Cover 2.0

2015-05-30 Thread Spencer Florence
Whoops, sorry! Knew we forgot something... Sorry about that!

Cover is a multi-file code coverage tool, designed to work like `raco test`.

On Sat, May 30, 2015 at 8:36 PM Hendrik Boom hend...@topoi.pooq.com wrote:

 On Sat, May 30, 2015 at 06:00:06PM +, Spencer Florence wrote:
  Hi All,
 
  We're pleased to announce the release of Cover 2.0!

 May I suggest that whenever anyone announces a new release of any software,
 that the announcement contains a brief description of what that software
 is intended to do, rather than just stating a few new features o fthe new
 release?

 -- hendrik

 
  Along with the various bug fixes, Cover now:
 
  * Is faster.
  * Is completely thread safe.
  * Has a new, easier to use, Racket API. This is to support integrating
 with
  IDE's and make new output formats easier to write.
 
  New contributors are always welcome!
  If you find bugs, you can open an issue at
  https://github.com/florence/cover/issues.
  In addition, if there are any new output formats, tools, or services that
  you think should be added, open an issue.
 
  Thanks!
 
  --Spencer  Ryan
 
  --
  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.


-- 
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] Capturing sets of options in a splicing syntax class?

2015-05-27 Thread Spencer Florence
try `syntax/parse/experimental/template`.

It gives you access to `??', which basically says use a if present, else
b, and some other cool templates besides. From the docs:

  (syntax-parse #'(m 1 2 3) [(_ (~optional (~seq #:op op:expr)) arg:expr
...) (template ((?? op +) arg ...))]) #syntax:197:0 (+ 1 2 3) 
(syntax-parse #'(m #:op max 1 2 3) [(_ (~optional (~seq #:op 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 (~seq (~or (~optional (~seq (~and #:a a?)))
   (~optional (~seq (~and #:b b?)))
   (~optional (~seq (~and #:c c?)))
   (~optional (~seq (~and #:d d?
  ...)
#:attr a/b #'(a? b?)
#:attr c/d #'(c? d?)))

 When using the above syntax class to parse #'(#:a #:d #:b), then the a/b
 attribute should be #'(#:a #:b) and the c/d attribute should be #'(#:d).
 However, this doesn't work, of course, because if one of the options isn't
 defined, the attribute will be #f, and the attribute binding will fail.

 I can get around that by doing 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?)))
   (~optional (~seq (~and #:d d?
  ...)
#:attr a/b #`(#,@(if (attribute a?) #'(a?) #'())
  #,@(if (attribute b?) #'(b?) #'()))
#:attr c/d #`(#,@(if (attribute c?) #'(c?) #'())
  #,@(if (attribute d?) #'(d?) #'()

 But that's rather long-winded and verbose. Even better would be a way to
 group the clauses within the pattern, something like this:

 (define-splicing-syntax-class options
   (pattern (~seq (~or (~and (~seq (~optional (~seq (~and #:a a?)))
   (~optional (~seq (~and #:b b?
 a/b)
   (~and (~seq (~optional (~seq (~and #:c c?)))
   (~optional (~seq (~and #:d d?
 c/d))
  ...)))

 But that obviously doesn't work, and I'm not sure what it would do even if
 it compiled.

 Anyway, is there a more concise way to do this? I know it's relatively
 easy using `template` from syntax/parse/experimental/template, but this is
 going into the Typed Racket code, so we're intentionally avoiding a
 dependency on that.

 Alexis

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


-- 
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] PLT policy on Travis CI bandwidth costs

2015-04-02 Thread Spencer Florence
Greg's Travis CI repo has a branch for using Travises cache, so that each
project would only download Racket once (per release). I don't know what
its state is though? It seems like that would be idea if it works.

https://github.com/greghendershott/travis-racket/tree/use-cache

On Thu, Apr 2, 2015 at 12:45 PM Matthew Butterick m...@mbtype.com wrote:

 OK, good to know. I will either switch to mirror.racket-lang.org or host
 the necessary installers on my own server.

 On Thu, Apr 2, 2015 at 9:38 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu
 wrote:

 Right now, Greg's script uses download.racket-lang.org, which is
 hosted on Amazon S3, and thus downloads cost (a small amount of)
 money. If you download from `mirror.racket-lang.org`, which is hosted
 at Northeastern, we're not charged for bandwidth. That's why those are
 the links you get by default on the web page. Similarly, the snapshot
 sites at Northwestern and Utah don't charge us for bandwidth.

 Sam



 On Thu, Apr 2, 2015 at 12:26 PM, Matthew Butterick m...@mbtype.com wrote:
  Should I be concerned about Travis CI's consumption of PLT bandwidth?
 Assuming the answer is yes, then question #2: what should I do about it?
 
  I just set up Travis CI on some of my Github projects (thanks Greg
 Hendershott for the Racket configuration script). IIUC every Travis build
 requires downloading Racket, and moreover, downloading Racket imposes
 bandwidth costs on PLT. So my use of Travis potentially consumes a lot of
 PLT's bandwidth for no benefit to PLT (aside from the usual refracted
 glory).
 
  I'd like to use Travis more (= build against more versions of Racket)
 but I don't want to be casual about the resource consumption. For instance,
 would there be an appopriate monthly fee to remit to PLT for this?
 
  --
  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.

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


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