Re: [racket-users] flat-contract-with-reason (should be flat-contract-with-explanation ?)

2016-10-23 Thread Robby Findler
Thanks. I've pushed a fix (to the docs).

Robby

On Sun, Oct 23, 2016 at 9:32 PM, Philip McGrath
 wrote:
> The Racket Reference documents a function "flat-contract-with-reason";
> however, in #lang racket, I get an unbound identifier error for
> "flat-contract-with-reason".
> I noticed that racket/contract/base does export a function
> "flat-contract-with-explanation", which seems to do what the docs say
> "flat-contract-with-reason" does — I'm guessing it somehow came to be
> documented under the wrong name?
> Philip
>
> --
> 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] flat-contract-with-reason (should be flat-contract-with-explanation ?)

2016-10-23 Thread Philip McGrath
The Racket Reference documents
 a
function "flat-contract-with-reason"; however, in #lang racket, I get an
unbound identifier error for "flat-contract-with-reason".
I noticed that racket/contract/base does export a function
"flat-contract-with-explanation", which seems to do what the docs say
"flat-contract-with-reason" does — I'm guessing it somehow came to be
documented under the wrong name?
Philip

-- 
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] degenerate performance in syntax-parse

2016-10-23 Thread Ryan Culpepper

On 10/21/2016 05:50 PM, Dan Liebgold wrote:

Hi all -

In the process of putting together a somewhat complex application
using syntax-parse, I discovered that when I specified a repeated
pattern in a syntax-class (which was incorrect) AND I had a certain
usage of the syntax transformer with an error, it would lead to
degenerate performance (Racket would run out of memory or it would
need to be killed.

Please see this example and uncomment the last non-paren line to see
it fall down:

http://pasterack.org/pastes/50261


The problem is that the `remap-entry` syntax class can succeed in 
multiple ways because of the repeated pattern. So when you have a macro 
use like


  (m remap-entry-1 remap-entry-2 ... remap-entry-n bad)

when parsing `bad` fails, syntax-parse backtracks and tries the other 
way of parsing all of the previous entries, so what should be a linear 
parse turns exponential.


The easiest fix is to add the #:commit option to the `remap-entry` 
syntax class. Then when `remap-entry` succeeds the first time, it throws 
away the choice points it created, so the repeated pattern is never 
considered.


It's usually reasonable to use #:commit with regular syntax classes 
(unless you're using syntax-parse to do logic programming). It's usually 
a bad idea to use it with splicing syntax classes, though, since it can 
lead to missed parses or bad error messages.


Two other comments:

1. A term like `(a <- blend)` will match the first pattern and treat 
`blend` as a `remap:id`. If you don't want that to happen, there are two 
ways to prevent it. One is to define a syntax class like `id` that 
excludes all of the reserved words like `<-` and `blend` and use that 
for pattern variables like `remap`. The other is to reorder the patterns 
and use cut (~!):


  (pattern (source:id <- blend ~! remap:id 
extras:remap-entry-extra-params))

  (pattern (source:id <- remap:id extras:remap-entry-extra-params))

2. `format-id` is useful for creating identifiers.

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] link: bad variable linkage

2016-10-23 Thread Laurent
As of now, I haven't experienced any more problem of this sort since then.
Admittedly I haven't tried hard either to reproduce this behavior.

So thank you so much for the time you took to look into this! Very
appreciated.


On Sat, Mar 26, 2016 at 11:53 PM, Robby Findler  wrote:

> Matthew and I have figured out one way in which DrRacket could go
> wrong here and implemented a better strategy. The problem we
> identified doesn't explain the symptoms expressed here in this thread
> exactly, but it is a complex system and maybe there was some piece
> missing from the explanations that I didn't think to ask about.
> Finger's crossed that it helps!
>
> In any case, if you are still experiencing the bad symptom after you
> get the latest code, please let me know.
>
> Thanks,
> Robby
>
> On Mon, Feb 1, 2016 at 9:03 AM, Laurent  wrote:
> > I would be so happy if this kind of error could be resolved! (even when
> all
> > files are compiled by DrRacket)
> > Usually, I just turn off "populate 'compiled' directories", but then
> > DrRacket needs to compile the file on each F5, which can take some
> precious
> > time.
> > Thank you both then :)
> >
> > On Sun, Jan 31, 2016 at 11:19 PM, jon stenerson <
> jonstener...@comcast.net>
> > wrote:
> >>
> >>
> >> The simplest thing I can find: I have three files in two directories.
> >> The first directory, called junk, contains a.rkt and b.rkt.
> >> The second directory is a sibling to junk called local-libs and contains
> >> c.rkt. (local-libs is known to the package manager; it was installed
> via the
> >> DrRacket interface).
> >> If I open all three files in DrRacket and try running a.rkt, sometimes
> it
> >> works, sometimes not. By modifiying a, b, c in some order (in the
> DrRacket
> >> editor) I can toggle the work/not work flag. As you say, it's a little
> >> non-deterministic.
> >>
> >> Thanks,
> >> Jon
> >>
> >>
> >> a.rkt:
> >> #lang racket
> >> (require "b.rkt")
> >>
> >> b.rkt
> >> #lang racket
> >> (require "../local-libs/c.rkt")
> >> (s 1)
> >>
> >> c.rkt
> >> #lang racket
> >> (provide (struct-out s) )
> >> (struct s (p))
> >>
> >>
> >>
> >>
> >> On 1/31/2016 4:03 PM, Robby Findler wrote:
> >>>
> >>> Then it would be helpful to us if you could provide some (hopefully
> >>> small) program and instructions to reproduce the problem.
> >>>
> >>> Thanks,
> >>> Robby
> >>>
> >>>
> >>> On Sun, Jan 31, 2016 at 4:51 PM, jon stenerson <
> jonstener...@comcast.net>
> >>> wrote:
> 
>  Just using DrRacket 6.3 on Win 10.
> 
>  Jon
> 
> 
>  On 1/31/2016 3:22 PM, Robby Findler wrote:
> >
> > The compilation of racket is (not yet) deterministic so things like
> > that can throw off internal tables in the .zo files (and a .zo files
> > is loaded without checking dependencies, optimistically hoping that
> > the files are not changed).
> >
> > So: are you using "raco make" or somehow mangaging .zo files
> yourself,
> > or are you seeing this with the .zo files that DrRacket maintains for
> > your automatically? If the former, then you need to adapt your
> > workflow to either not use .zo files or to keep them up to date. If
> > the latter, then it is a bug.
> >
> > Robby
> >
> >
> >
> > On Sun, Jan 31, 2016 at 4:17 PM, jon stenerson
> > 
> > wrote:
> >>
> >> I have some .rkt files and, depending on which file was edited most
> >> recently, either it works fine or it gives a compilation error. (By
> >> "edited"
> >> I mean just adding or subtracting a blank line to change the
> >> timestamp).
> >> I
> >> can submit a simplified example if nobody else has seen this
> problem.
> >> If
> >> this is well-known, what is the fix?
> >>
> >> link: bad variable linkage;
> >>reference to a variable that is not a procedure or structure-type
> >> constant
> >> across all instantiations
> >> reference phase level: 0
> >> variable module: 
> >> variable phase: 0
> >> reference in module:  in: 
> >>
> >> --
> >> 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 

Re: [racket-users] raco run but (please) dont process the docs

2016-10-23 Thread Matthew Flatt
I'll bring that FAQ up-to-date to explain that built packages are now
provided by the catalog

 https://pkg-build.racket-lang.org/server/built/catalog/

See also

 https://pkg-build.racket-lang.org/about.html


At Sun, 23 Oct 2016 12:16:02 +0200, Daniel Brunner wrote:
> Hi Meino,
> 
> have a look at this FAQ:
> 
> http://docs.racket-lang.org/pkg/FAQ.html#%28part._.How_can_.I_install_a_package
> _without_its_documentation_%29
> 
> For some packages there exist two "sub" packages: One with "...-lib"
> which does not contain any documentation and does not depend on scribble
> etc. and a package which includes only the docoumentation "...-doc".
> 
> This does not work for all packages. Those who do not seperate the code
> from the documentation you could stick with "binary" or "built"
> packages: http://docs.racket-lang.org/pkg/strip.html
> 
> At the moment you have to build these packages yourself and put them on
> your device for installation. As far as I know there are future plans to
> provide these packages online.
> 
> 
> Best wishes,
> Daniel
> 
> 
> Am 23.10.2016 um 11:09 schrieb meino.cra...@gmx.de:
> > Hi,
> > 
> > I have installed racket on my Android tablet.
> > For this I have the device rooted
> > and installed a chrooted Archlinux,
> > which in turn provides the prebuild
> > racket-package 6.6.
> > By the way: The tablet has a x86 iIntel CPU
> > but nothing "big iron"-like. About 400MB
> > free RAM is available.
> > 
> > BUT:
> > When I install an additional package like csv-reading
> > via raco pkg install it also processes the scribble
> > docs to pdf via TeX of that package.
> > And that's much too much for my little tablet.
> > It instantly kills the terminal app and resets.
> > 
> > It there any way to tell raco what kind
> > of doc processing is wanted and what don't?
> > 
> > Cheers,
> > Meino
> > 
> > 
> > 
> 
> -- 
> 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] raco run but (please) dont process the docs

2016-10-23 Thread Meino . Cramer
Asumu Takikawa  [16-10-23 18:12]:
> Hi Meino,
> 
> On 2016-10-23 11:09:48 +0200, meino.cra...@gmx.de wrote:
> > It there any way to tell raco what kind
> > of doc processing is wanted and what don't?
> 
> In addition to Daniel's answer, there is a temporary workaround you can do 
> which
> is to install a package with the --no-setup flag like this:
> 
>   raco pkg install --no-setup 
>   raco setup -D
> 
> the -D flag to setup tells it to avoid building docs.
> 
> Cheers,
> Asumu
> 
Hi Asumu,

 OH GREAT ! :)
 Now I will be able to do racket programming on
 my little tablet while commuting to and from work home!

 (NICE)

 :)

 Thanks a lot for that info, Asumu.
 Cheers,
 Meino


-- 
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] raco run but (please) dont process the docs

2016-10-23 Thread Asumu Takikawa
Hi Meino,

On 2016-10-23 11:09:48 +0200, meino.cra...@gmx.de wrote:
> It there any way to tell raco what kind
> of doc processing is wanted and what don't?

In addition to Daniel's answer, there is a temporary workaround you can do which
is to install a package with the --no-setup flag like this:

  raco pkg install --no-setup 
  raco setup -D

the -D flag to setup tells it to avoid building docs.

Cheers,
Asumu

-- 
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] n things in one go and: How to search for something unkown?

2016-10-23 Thread Meino . Cramer
Hi,


A more general question:
I am no native english speaker and a newbie when it
comes to Racker/Lisp/Functional programming.

Suppose I want the name of a function or functionality
(like this genious 'apply map' algorithm to hurry through
a list of lists) - how/where can I search for it if I
cannot name it?

Is there a 'Racket Cookbook' like the 'Perl Cookbook' somewhere
or something similiar?

(Cheers)
Meino






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

2016-10-23 Thread Masto Fine
please help me , i start on racket and i should write a little programm 
"digital clock" in exercice . i have just a book without answer to help me . 
this is what i write .
please correct me and give the good answer !
: (define (horloge-numerique T)
(local [(define LARG 100)
(deinne HAUT 100)
(define SCENE (rectangle LARG HAUT 'solid "grey"))
(define NUMBER (integer 10 20 "black"))
(define X0 (/ LARG 2))
(define Y0 (/ HAUT 2))
; le ùmonde est une suite de chiffre allant de 1 jusqu'à 59
(define INIT 0)
(define dT ((NUMBER->digits 123...59)->(NUMBER -> listof-numbers 1 
2 3 ... 59)))
(define (suivant T)
  (+ T dT))
(define (dessiner T)
  (place image listof-number X0 YO SCENE))
(define (final? T)
  (>= T 59))]
(big-bang INIT
  (on-tick suivant)
  (on-draw dessiner LARG HAUT)
  (stop-when final?
thank you for all

-- 
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] raco run but (please) dont process the docs

2016-10-23 Thread Daniel Brunner
Hi Meino,

have a look at this FAQ:

http://docs.racket-lang.org/pkg/FAQ.html#%28part._.How_can_.I_install_a_package_without_its_documentation_%29

For some packages there exist two "sub" packages: One with "...-lib"
which does not contain any documentation and does not depend on scribble
etc. and a package which includes only the docoumentation "...-doc".

This does not work for all packages. Those who do not seperate the code
from the documentation you could stick with "binary" or "built"
packages: http://docs.racket-lang.org/pkg/strip.html

At the moment you have to build these packages yourself and put them on
your device for installation. As far as I know there are future plans to
provide these packages online.


Best wishes,
Daniel


Am 23.10.2016 um 11:09 schrieb meino.cra...@gmx.de:
> Hi,
> 
> I have installed racket on my Android tablet.
> For this I have the device rooted
> and installed a chrooted Archlinux,
> which in turn provides the prebuild
> racket-package 6.6.
> By the way: The tablet has a x86 iIntel CPU
> but nothing "big iron"-like. About 400MB
> free RAM is available.
> 
> BUT:
> When I install an additional package like csv-reading
> via raco pkg install it also processes the scribble
> docs to pdf via TeX of that package.
> And that's much too much for my little tablet.
> It instantly kills the terminal app and resets.
> 
> It there any way to tell raco what kind
> of doc processing is wanted and what don't?
> 
> Cheers,
> Meino
> 
> 
> 

-- 
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] raco run but (please) dont process the docs

2016-10-23 Thread Meino . Cramer
Hi,

I have installed racket on my Android tablet.
For this I have the device rooted
and installed a chrooted Archlinux,
which in turn provides the prebuild
racket-package 6.6.
By the way: The tablet has a x86 iIntel CPU
but nothing "big iron"-like. About 400MB
free RAM is available.

BUT:
When I install an additional package like csv-reading
via raco pkg install it also processes the scribble
docs to pdf via TeX of that package.
And that's much too much for my little tablet.
It instantly kills the terminal app and resets.

It there any way to tell raco what kind
of doc processing is wanted and what don't?

Cheers,
Meino



-- 
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] Re: opinions on YAML as communication tool

2016-10-23 Thread Konrad Hinsen

On 21/10/2016 23:00, Jack Firth wrote:


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:

...

Google for "YAML Norway" for some real-life illustrations of this 
problem. The ISO country code for Norway is "no", which the YAML parser 
converts into "false".


Konrad.

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