Re: [racket-users] defstruct* fails for a (long long long) long struct name

2017-03-11 Thread Carlos Lopez
Thanks!
it was confusing to see that changing "They" fixed he problem.



On Saturday, March 11, 2017 at 6:05:27 PM UTC-5, Ben Greenman wrote:
> Adding a field also fixes the problem:
> 
> 
> 
> #lang scribble/manual
> 
> 
> 
> 
> @require[@for-label[racket]]
> 
> 
> 
> 
> @defstruct*[(abcdefghijklmnopqrstuvwxyzABCDEEFGHIJKLMNOPQRSTUVWX-Z ABCD) ([hi 
> integer?])]{}
> 
> 
> 
> 
> and the problem has to do with how `defstruct*` renders the first line of a 
> struct declaration. If the struct name and first field's name are short 
> enough, it renders both on the same line. When they're* too long, it renders 
> the first field name on a new line --- and assumes the struct has at least 
> one field.
> 
> 
> This is a bug. Once it's fixed, you'll be able to document the long names 
> correctly.
> 
> 
> * "They" = the struct's name + the first field's name (if present) + some 
> padding
> 
> 
> On Sat, Mar 11, 2017 at 5:36 PM, Carlos Lopez  wrote:
> Hi,
> 
> 
> 
> While writing some documentation in scribble, I've discovered that using 
> defstruct with really long names gives an error:
> 
> 
> 
> the following code fails:
> 
> 
> 
> #lang scribble/manual
> 
> 
> 
> @require[@for-label[racket]]
> 
> 
> 
> @defstruct*[(abcdefghijklmnopqrstuvwxyzABCDEEFGHIJKLMNOPQRSTUVWX-Z ABCD) ()]{}
> 
> 
> 
> 
> 
> yet removing a character in either the long string or in ABCD makes it work.
> 
> 
> 
> Dr. Racket provides a stacktrace but I'm unable to understand what the issue 
> is.
> 
> 
> 
> I'd like to understand what kind of limit is being broken.
> 
> 
> 
> best,
> 
> carlos
> 
> 
> 
> --
> 
> 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...@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] defstruct* fails for a (long long long) long struct name

2017-03-11 Thread Ben Greenman
Adding a field also fixes the problem:

#lang scribble/manual

@require[@for-label[racket]]

@defstruct*[(abcdefghijklmnopqrstuvwxyzABCDEEFGHIJKLMNOPQRSTUVWX-Z ABCD)
([hi integer?])]{}



and the problem has to do with how `defstruct*` renders the first line of a
struct declaration. If the struct name and first field's name are short
enough, it renders both on the same line. When they're* too long, it
renders the first field name on a new line --- and assumes the struct has
at least one field.

This is a bug. Once it's fixed, you'll be able to document the long names
correctly.

* "They" = the struct's name + the first field's name (if present) + some
padding

On Sat, Mar 11, 2017 at 5:36 PM, Carlos Lopez  wrote:

> Hi,
>
> While writing some documentation in scribble, I've discovered that using
> defstruct with really long names gives an error:
>
> the following code fails:
>
> #lang scribble/manual
>
> @require[@for-label[racket]]
>
> @defstruct*[(abcdefghijklmnopqrstuvwxyzABCDEEFGHIJKLMNOPQRSTUVWX-Z ABCD)
> ()]{}
>
>
> yet removing a character in either the long string or in ABCD makes it
> work.
>
> Dr. Racket provides a stacktrace but I'm unable to understand what the
> issue is.
>
> I'd like to understand what kind of limit is being broken.
>
> best,
> carlos
>
> --
> 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] defstruct* fails for a (long long long) long struct name

2017-03-11 Thread Carlos Lopez
Hi,

While writing some documentation in scribble, I've discovered that using 
defstruct with really long names gives an error:

the following code fails:

#lang scribble/manual

@require[@for-label[racket]]

@defstruct*[(abcdefghijklmnopqrstuvwxyzABCDEEFGHIJKLMNOPQRSTUVWX-Z ABCD) ()]{}


yet removing a character in either the long string or in ABCD makes it work.

Dr. Racket provides a stacktrace but I'm unable to understand what the issue 
is. 

I'd like to understand what kind of limit is being broken.

best,
carlos

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

2017-03-11 Thread WarGrey Gyoudmon Ju
I have this issue in Racket 6.8.0.1 this morning, the project is compiled
by compile-directory-zos, and all .zos are ensured up-to-date.
Before I gave up, I had wrote a simple tests in DrRacket, lucky to saw the
root cause, a contract error in the body of the newly added typed class,
but the issue was reported with two totally irrelevant modules.

On Sat, Feb 4, 2017 at 9:31 AM, Robby Findler 
wrote:

> This is the commit:
>
> https://github.com/racket/drracket/commit/81d74e484c306c3584030cf8ede298
> 25c0e8be1a
>
> I pushed it around the time 6.5 was released and it is the kind of
> thing I would do right after a release branch has been created, so
> probably it was only 6.6 and later.
>
> Robby
>
>
>
> On Fri, Feb 3, 2017 at 7:15 PM, Dan Liebgold
>  wrote:
> > On Saturday, March 26, 2016 at 4:53:51 PM UTC-7, 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!
> >>
> >
> > I was getting this error and variations on it somewhat often in version
> 6.5. Do you think upgrading to 6.8 will help?
> >
> > Thanks,
> > Dan
> >
> > --
> > 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] Is there any way I can use the terse forms of quasiquote with at-exp?

2017-03-11 Thread Matthew Flatt
You could use

 , @~a{}

with a space between `,` and `@`.


Since that's sometimes too ugly, though, `@` has special handling of
comma that effectively swaps the order of the `@` and `,`. So, you
could use

  @,~a{}

to get the effect of

  ,@~a{}

without `,` combining `@`.


Note that if you just wanted to unquote `~a`, then you'd have to use
vertical bars to prevent `@,` from acting like `,@`:

  @|,~a|{}



Although

  @pregexp{\d\.\d}

s much nicer than

  #px"\\d\\.\\d"

beware that the former will compile the regexp every time the
expression is evaluated. Maybe we can eventually fix that. Meanwhile,
be sure to lift the expression to a module-level definition.


At Sat, 11 Mar 2017 15:31:54 +, Stephen De Gabrielle wrote:
> Hi,
> 
> Is there any way I can use the terse forms of quasiquote with at-exp?
> 
> I want to use @expressions{} inside a quasi quoted list, but the unquote
> comma captures the at-sign at ,@a~{}
> 
> I'm trying to achieve the following with the at-exp
> 
> ;working example
> #lang at-exp racket
> (require racket/random)
> (define (path)
>   (random-ref '["stream""brook" "path" "ravine" "forest" "fence" "stone
> wall"]))
> 
> (~a "beyond the " (path) ", ")
> @~a{beyond the @(path), }
> 
> 
> (random-ref
>  `(
>,(~a "beyond the " (path) ", ")
>   ;,@~a{beyond the @(path) })
>,(~a "along the " (path) ", ")
>   ;,@~a{beyond the @(path) })
>))
> 
> My reason is I find at-expressions more readable.
> 
> Kind regards,
> 
> Stephen
> 
> PS: Ive been very excited by at-exp since I read
> http://www.greghendershott.com/2015/08/at-expressions.html
> I despise double escaping, because I always make a mistake, so this made me
> very happy:
> 
> @pregexp{\d\.\d}  ; #px"\\d\\.\\d"
> 
> -- 
> 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] Is there any way I can use the terse forms of quasiquote with at-exp?

2017-03-11 Thread Stephen De Gabrielle
Hi,

Is there any way I can use the terse forms of quasiquote with at-exp?

I want to use @expressions{} inside a quasi quoted list, but the unquote
comma captures the at-sign at ,@a~{}

I'm trying to achieve the following with the at-exp

;working example
#lang at-exp racket
(require racket/random)
(define (path)
  (random-ref '["stream""brook" "path" "ravine" "forest" "fence" "stone
wall"]))

(~a "beyond the " (path) ", ")
@~a{beyond the @(path), }


(random-ref
 `(
   ,(~a "beyond the " (path) ", ")
  ;,@~a{beyond the @(path) })
   ,(~a "along the " (path) ", ")
  ;,@~a{beyond the @(path) })
   ))

My reason is I find at-expressions more readable.

Kind regards,

Stephen

PS: Ive been very excited by at-exp since I read
http://www.greghendershott.com/2015/08/at-expressions.html
I despise double escaping, because I always make a mistake, so this made me
very happy:

@pregexp{\d\.\d}  ; #px"\\d\\.\\d"

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