[racket-users] plan for the upcoming v7.0 release

2018-05-26 Thread Matthew Flatt
The next release of Racket will be version 7.0:

* Version 7.0 is a milestone on our path to replace the old,
  C-implemented runtime system with Chez Scheme.

* As such, version 7.0 reflects MAJOR INTERNAL CHANGES that make
  Racket-on-Chez possible --- especially the switch to a new
  implementation of the macro expander.

* Version 7.0 does *not* mean that we're switching to Racket-on-Chez as
  the main Racket implementation. We're not there yet.

We do not expect Racket users to see a big difference between Racket
v6.12 and Racket v7.0. But, since the internals differ significantly, a
major-version bump tracks that change.

The internal changes make bugs and unintended incompatibilities more
likely than for a typical Racket release. To mitigate that risk, we
skipped a release cycle to give the v7 changes time to settle. We also
plan an extra "beta" testing cycle to give users a few weeks to try out
a candidate v7 release.

The v7-beta process will be similar to a normal release process, except
that we'll stop before the step of pushing v7 to the download sites.
Instead, https://pre-release.racket-lang.org/ will freeze with a "beta"
version for a few weeks. After getting feedback on that beta version,
we'll restart testing (because we anticipate changes and repairs from
the beta phase) and finish up the v7 release normally.

Here's the schedule:

 * June 7: branch date for Racket v7-beta

 We create a branch of the main Racket repository, and thereafter
 apply only bug fixes or changes approved by release management.

 * June 20-something: v7-beta "release" date

 We freeze the build at https://pre-release.racket-lang.org/,
 publicly announce that beta testing has started, and request your
 feedback.

 * July 15: start v7 testing with v7-beta branch -> v7 branch

 We restart our release-time tests to check repairs for problems
 that were detected during beta testing.

 * Late July: v7 release


Thanks in advance for your help making the v7 transition a success!

- Racket release management

-- 
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] Questions on functional-setter generator macro

2018-05-26 Thread Alexis King
This isn’t a direct answer to your question, but as Matthias notes, my
struct-update package already implements a macro that generates
functional setters from structure definitions. Here’s a link to the
documentation:

http://docs.racket-lang.org/struct-update/index.html

Of course, that isn’t especially helpful if your goal is to get better
at authoring macros, not just generate functional setters. For that, you
might find the (short) source code of struct-update helpful, located
here:


https://github.com/lexi-lambda/struct-update/blob/8ce456cde8764ae27c348123ec9e01e76826d536/struct-update-lib/struct-update/main.rkt

Admittedly, your make-functional-setter function does a bit more than
define-struct-updaters, since it allows for a wrapper function. So I’ll
also give some brief answers to a few of your unrelated questions.

> On May 26, 2018, at 10:46, David Storrs 
> wrote:
> 
> A) Is there a way to test if a syntax class has a particular attribute
> before trying to use it?

Yes, use the attribute form. If x is an optional attribute, (attribute
x) will be #f if the attribute was not bound and the value of the
attribute if it was bound. If you want, you can change the default value
to something else other than #f by providing the #:defaults option to
~optional.

> B) Alternatively, is there a way to create a null syntax object that
> expands to nothing?  Not (void), not "", literally nothing.   Then I
> could have each pattern bind all the attributes via #:with and just
> have some of them be blank.

Not in an arbitrary context. In a definition context, (begin)
effectively expands into nothing, since begins are spliced into the
enclosing context, but in an expression context, you can’t have
something that expands into nothing.

That said, it sounds like what you might actually want is the template
and ?? forms from syntax/parse/experimental/template. This allows you
to write something like this:

(template (foo (?? x)))

The above will be like #'(foo x) if (attribute x) is non-#f, but if it
is #f, it will be like #'(foo). In Racket 6.12 and earlier, you must use
the template form for ?? to work, but in Racket 7 and later, ?? will
also work with the ordinary syntax (aka #') form, so if the word
“experimental” spooks you, don’t worry about it too much.

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.


Re: [racket-users] Questions on functional-setter generator macro

2018-05-26 Thread Matthias Felleisen

You may wish to study Alexis’s struct updater package: 
https://github.com/lexi-lambda/struct-update 
 


> On May 26, 2018, at 11:46 AM, David Storrs  wrote:
> 
> Hi folks,
> 
> I am becoming more converted to the way of structs vs hashes as time goes on 
> and so I sat down to write a macro that would generate functional setters as 
> a convenience.  Code is at bottom of email; I'd appreciate suggestions on how 
> to improve it, in particular better ways of handling macros that have 
> multiple optional parts, e.g.:
>
>(struct foo (bar baz jaz))
>(make-functional-setter foo bar)
>(make-functional-setter foo baz string?)
>(make-functional-setter foo jaz path-string? path-string->string)
> 
> I've seen this handled in two ways:
> 
> 1) define-syntax-class with multiple (pattern ...) clauses, which renders the 
> parsing cleaner and easier to understand.  Handling missing parts is still an 
> issue, since using an attribute that wasn't matched is a syntax error, so my 
> questions:
> 
> A) Is there a way to test if a syntax class has a particular attribute before 
> trying to use it?
> 
> B) Alternatively, is there a way to create a null syntax object that expands 
> to nothing?  Not (void), not "", literally nothing.   Then I could have each 
> pattern bind all the attributes via #:with and just have some of them be 
> blank.
> 
> 
> 2) Alternatively, macros with optional parts can be handled by a series of 
> test cases in a syntax-parse, one for each option.  That ends up with a lot 
> of copy/pasted code between the segments.  I'm getting around this via 
> re-parsing but that feels clumsy.  What is the better way?
> 
> 
> 3) There's something I'm not understanding about providing this thing.  I 
> have it in a file called make_functional_setter.rkt:
> 
> #lang racket
> (require (for-syntax racket/syntax syntax/parse))
> (provide make-functional-setter)
> ; code and comments for make-functional-setter, see bottom of email
> 
> When I (require "../make_functional_setter.rkt") on the CLI racket shell, 
> everything works great.  As soon as I try to require it into a file, it fails:
> 
> Contents of file test.rkt:
> 
> #lang racket
> (struct bar (a b))
> (require "../make_functional_setter.rkt") 
> (make-functional-setter bar a)
> (make-functional-setter bar b path-string? ~a)
> 
> When I do "racket test.rkt" on the command line, I get the following 
> exception:
> 
> bar?: unbound identifier in module
>   context...:
>#(2082 module test 0) #(3901 module) #(3902 module struct 0) #(25633 macro)
>#(25639 use-site) #(25818 local) #(25820 intdef)
>   other binding...:
>#f
>#(2081 module) #(2082 module test 0)
>   in: bar?
>   context...:
>standard-module-name-resolver
> 
> I've been through this in the DrRacket macro stepper but that hasn't helped 
> me any.  (It rarely does.)
> 
> I'm assuming it's a phase issue, so I've played around with for-syntax, 
> for-template, and for-meta but apparently I do not understand phases well 
> enough.
> 
> What could be causing this?
> 
> 
> 
> I've been going through all the macro- and syntax-related docs that I can 
> find, but there's a lot of them and they take a few re-reads to sink in, so 
> there's probably something exactly for this that I haven't seen.
> 
> Code is below and at 
> https://gist.github.com/dstorrs/a53ec8736551eb5745d1d5fd265b5062 
>  in case 
> Gmail mangled the formatting.
> 
> 
> ;; make-functional-setter: macro for generating non-mutating field
> ;; setter functions for a struct
> ;;
> ;; Define a struct:  (struct book (title current-page filepath) #:transparent)
> ;;
> ;; Generate 'set-book-title', 'set-book-current-page', and 
> 'set-book-filepath'.
> ;; All of these take two to four arguments: the 'book' struct to update, the 
> ;; new value, an optional contract, and an optional wrapper function.
> ;;
> ;;(make-functional-setter book title)
> ;;(make-functional-setter book current-page  exact-positive-integer?)
> ;;(make-functional-setter book filepath  path-string?
> path-string->string)
> ;;
> ;; Details:
> ;;set-book-title   accepts any value, regardless of sensibility
> ;;set-book-current-pageaccepts only exact-positive-integer?s, else 
> contract violation
> ;;set-book-filepathaccepts only path-string?s, converts to string 
> before storing
> ;;
> ;; Examples:
> ;;(define b (book "Foundation" 297 (build-path "/foo/bar")))
> ;;b; (book "Foundation" 
> 297 "/foo/bar")
> ;;(set-book-title b (hash)); (book (hash) 297 
> "/foo/bar")
> ;;(set-book-current-page b 99) ; (book "Foundation" 
> 99 "/foo/bar")
> ;;(set-book-current-page b 'x) ; ERROR!  Contract 
> violation
> ;;(set-book-filepath b 

[racket-users] Questions on functional-setter generator macro

2018-05-26 Thread David Storrs
Hi folks,

I am becoming more converted to the way of structs vs hashes as time goes
on and so I sat down to write a macro that would generate functional
setters as a convenience.  Code is at bottom of email; I'd appreciate
suggestions on how to improve it, in particular better ways of handling
macros that have multiple optional parts, e.g.:

   (struct foo (bar baz jaz))
   (make-functional-setter foo bar)
   (make-functional-setter foo baz string?)
   (make-functional-setter foo jaz path-string? path-string->string)

I've seen this handled in two ways:

1) define-syntax-class with multiple (pattern ...) clauses, which renders
the parsing cleaner and easier to understand.  Handling missing parts is
still an issue, since using an attribute that wasn't matched is a syntax
error, so my questions:

A) Is there a way to test if a syntax class has a particular attribute
before trying to use it?

B) Alternatively, is there a way to create a null syntax object that
expands to nothing?  Not (void), not "", literally nothing.   Then I could
have each pattern bind all the attributes via #:with and just have some of
them be blank.


2) Alternatively, macros with optional parts can be handled by a series of
test cases in a syntax-parse, one for each option.  That ends up with a lot
of copy/pasted code between the segments.  I'm getting around this via
re-parsing but that feels clumsy.  What is the better way?


3) There's something I'm not understanding about providing this thing.  I
have it in a file called make_functional_setter.rkt:

#lang racket
(require (for-syntax racket/syntax syntax/parse))
(provide make-functional-setter)
; code and comments for make-functional-setter, see bottom of email

When I (require "../make_functional_setter.rkt") on the CLI racket shell,
everything works great.  As soon as I try to require it into a file, it
fails:

Contents of file test.rkt:

#lang racket
(struct bar (a b))
(require "../make_functional_setter.rkt")
(make-functional-setter bar a)
(make-functional-setter bar b path-string? ~a)

When I do "racket test.rkt" on the command line, I get the following
exception:

bar?: unbound identifier in module
  context...:
   #(2082 module test 0) #(3901 module) #(3902 module struct 0) #(25633
macro)
   #(25639 use-site) #(25818 local) #(25820 intdef)
  other binding...:
   #f
   #(2081 module) #(2082 module test 0)
  in: bar?
  context...:
   standard-module-name-resolver

I've been through this in the DrRacket macro stepper but that hasn't helped
me any.  (It rarely does.)

I'm assuming it's a phase issue, so I've played around with for-syntax,
for-template, and for-meta but apparently I do not understand phases well
enough.

What could be causing this?



I've been going through all the macro- and syntax-related docs that I can
find, but there's a lot of them and they take a few re-reads to sink in, so
there's probably something exactly for this that I haven't seen.

Code is below and at
https://gist.github.com/dstorrs/a53ec8736551eb5745d1d5fd265b5062 in case
Gmail mangled the formatting.


;; make-functional-setter: macro for generating non-mutating field
;; setter functions for a struct
;;
;; Define a struct:  (struct book (title current-page filepath)
#:transparent)
;;
;; Generate 'set-book-title', 'set-book-current-page', and
'set-book-filepath'.
;; All of these take two to four arguments: the 'book' struct to update,
the
;; new value, an optional contract, and an optional wrapper function.
;;
;;(make-functional-setter book title)
;;(make-functional-setter book current-page  exact-positive-integer?)
;;(make-functional-setter book filepath  path-string?
 path-string->string)
;;
;; Details:
;;set-book-title   accepts any value, regardless of sensibility
;;set-book-current-pageaccepts only exact-positive-integer?s, else
contract violation
;;set-book-filepathaccepts only path-string?s, converts to
string before storing
;;
;; Examples:
;;(define b (book "Foundation" 297 (build-path "/foo/bar")))
;;b; (book "Foundation"
297 "/foo/bar")
;;(set-book-title b (hash)); (book (hash) 297
"/foo/bar")
;;(set-book-current-page b 99) ; (book "Foundation"
99 "/foo/bar")
;;(set-book-current-page b 'x) ; ERROR!  Contract
violation
;;(set-book-filepath b (build-path "/foo")); (book "Foundation"
297 "/foo")
;;
(define-syntax (make-functional-setter stx)
  (syntax-parse stx
; First, grab the name of the struct and the field we're making
; this for.  We'll build some stuff here then re-parse instead of
; copy/pasting for every pattern match
[(_ type-name field-name ignored ...)
 (with-syntax* ([func-name   (format-id #'type-name "set-~a-~a"
#'type-name #'field-name)]
[func-header #'(func-name the-struct val)]
[definer #'define]

[racket-users] Re: github for third-party racket packages

2018-05-26 Thread HiPhish
I personally use GitLab over GitHub for various reasons, but for the 
purpose of this topic they are both interchangeable. Git is a decentralized 
system, so it doesn't really matter what you host it on, you could even 
host the project on some potato connected to the internet using a piece of 
wire.

There are basically two ways to view GitHub: as just a host for your code 
and as a platform for managing your project. If you only want to use it as 
a host it's no different from any other Git platform, but you are on your 
own when it comes to managing issues, patches and so on. If you want to use 
it to manage your project, then people who want to contribute will need a 
GitHub account. This is generally not a problem since pretty much everyone 
has one at this point, but keep in mind that the GitHub web interface does 
require non-free JavaScript (GitLab does not have this issue, and you can 
use your GitHub account with GitLab):
https://www.gnu.org/software/repo-criteria-evaluation.html

Other than that the workflow is pretty smooth and I have no complaints. It 
has some nice features like turning issue numbers into links, Markdown 
syntax and so on.

Integration with the Racket package management is no issue either. The web 
interface is aware of Git and works with any hosting service. I personally 
prefer to have the source code in a sub-directory of the project rather 
than in the root, and Racket supports this feature as well, like this:
https://gitlab.com/HiPhish/MsgPack.rkt
https://pkgs.racket-lang.org/package/msgpack

As for projects you don't want to publish, last time I checked you needed a 
paid GitHub account for that. GitLab offers private repositories for free, 
but it may be limited to a certain number and certain size, I don't know.

On Wednesday, May 23, 2018 at 8:51:16 PM UTC+2, Neil Van Dyke wrote:
>
> I'm thinking of moving all my open source third-party Racket packages to 
> GitHub, and had some questions, for other third-party developers... 
>
> 1. How do third-party developers of polished Racket packages like using 
> GitHub?  (Example questions... What friction is there still, to rapidly 
> making a change and a new release that appears in the Racket package 
> catalog?  Do you know whether being on GitHub imposes extra work over 
> non-GitHub for some things?  With GitHub, is there more work to go 
> through issue reports and pull requests, and process within the Web 
> site, because it happens to be convenient or in pursuit of metrics, as 
> opposed to receiving issue reports limited to ones people felt were 
> important enough to email you about privately?  How do you deal with 
> using GitHub for SCM of non-commercial stuff that you're not ready to 
> release?  Noticed any signs that GitHub might not always be as 
> warm-fuzzy, or have any unease about implicitly encouraging other people 
> to use it?) 
>
> 2. Has anyone automated migrating a history of Racket package releases 
> to Git (or to GitHub, specifically)?  (Rather than converting to Git 
> from a different SCM system, I'd be converting a history of release 
> packages from pre-PLaneT, PLaneT, and the current package system, and 
> want to have version tagging/labeling/naming happen.  I'm not sure it's 
> a good idea, since files were shuffled around within packages over the 
> last 17 years, for various reasons, but I'd like a sense of how much 
> work it would be.  An alternative, which I suspect is what I'll end up 
> doing if I move at all, is just to put the source from each last release 
> in Git, and not try to capture the history before that.) 
>
> Background: My Racket open source releases are in minimal maintenance 
> mode, while I do a career shift, from gov't independent consulting, to 
> academic/non-profit/industry research/engineering/policy.  Also, my 
> Racket package release workflow is friction-y for the last few years, so 
> every urgent quick release in response to some issue someone is facing 
> feels like more work than it should be, and so I haven't tried to 
> release various unreleased packages that have been sitting around for 
> years, and I ceased the occasional evening/weeking whipping up of a new 
> package intended for release.  My top priority for my Racket open source 
> code is to continue to provide support for packages that I've already 
> released, and my second priority is to be in a position that I could 
> easily ramp back up releasing polished new stuff at later date. 
>
>

-- 
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] crashing scrollbars (gtk3 bug?)

2018-05-26 Thread Simon Schlee
Hello,

while writing this email I found a solution to my problem.
By setting the PLT_GTK2 environment variable to:
export PLT_GTK2=/usr/lib64/libgtk-x11-2.0.so
like described in https://docs.racket-lang.org/gui/libs.html
The program runs with gtk2 and no longer crashes (with gtk3 it does for me)

This seems to indicate that this is gtk3 bug.
Below my original question. 

I have a short gui program which crashes when I move my cursor over the 
list box and then leave its area while passing the scrollbar.
I am not sure whether this is a gtk or racket bug.

I am running Manjaro 17.1 with Xfce 4.12 and Racket v6.12
Someone on irc tried it and could not reproduce it with Xfce 4.12 and 
Racket v6.12.

Here is the program:

#lang racket

(require racket/gui)

(module+ main
  (define frame (new frame% [label "Bug: crashing scrollbars"]))
  (define box (new list-box%
   [label #f]
   [choices (list "A" "B")]
   [parent  frame]))
  (send frame show #t))

;; after leaving the list-box hovering over the scrollbar with the mouse:
;; Gtk: _gtk_css_image_get_concrete_Thank you
size: assertion 'default_width > 0' failed
;; Gtk: _gtk_css_image_get_surface: assertion 'surface_width > 0' failed
;; SIGSEGV MAPERR si_code 1 fault on addr 0x1c
;; [1]4105 abort (core dumped)  racket gtkbug.rkt

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