Re: [racket-users] bad response from server

2020-03-03 Thread Hendrik Boom
On Mon, Mar 02, 2020 at 12:54:41PM -0700, Matthew Flatt wrote:
> A snapshot catalog only lasts for a limited time, and v7.4.0.1 was a
> very long time ago in snapshot terms.

I see. That's what I suspected.

> 
> So, the short answer is to upgrade to a new snapshot --- or switch to a
> release, which doesn't time out.

And I switched to a release, which was more current than the snapshot,
and it worked, as expected.

-- hendrik
> 
> At Mon, 2 Mar 2020 14:46:25 -0500, Hendrik Boom wrote:
> > When trying to u[dat catalog I get a message
> > 
> > get-all-pkg-details-from-catalogs: bad response from server
> >   url: 
> > https://www.cs.utah.edu/plt/snapshots/20190720-93f4c9226b/catalog/pkgs-all?vers
> > ion=7.4.0.1
> >   response: #f
> > 
> >   (for-loop . #(struct:srcloc 
> > # 299 2 
> > 11021 1759))
> >   (for-loop . #(struct:srcloc 
> > #
> >  
> > 37 4 1350 2495))
> >   (pkg-catalog-update-local13 . #(struct:srcloc 
> > #
> >  
> > 15 0 286 3561))
> >   (#f . #(struct:srcloc 
> > # > first.rkt> 555 3 23822 3167))
> >   (for-loop . #(struct:srcloc 
> > # > ate/catalog-update.rkt> 99 7 3851 437))
> >   (.../more-scheme.rkt:261:28 . #f)
> > 
> > 
> > I'm running using an old nightly build.
> > Does this mean I need to install a new daily build?
> > Or is the regular Racket distribution 
> > already more up-tp-date them 2019 07 20?
> > 
> > -- 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/20200302194625.bnkor6si3bkecxsx%
> > 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/20200303222643.5glteha3jrc75c66%40topoi.pooq.com.


[racket-users] London Racket meet-up 9 April 1-2pm

2020-03-03 Thread Stephen De Gabrielle
London Racket Meet-up

Thursday 9th April 1-2pm

Meet at 1pm at ‘The Last Word’ (cafe)[1] and after introductions we will
move to The Alan Turing Institute[2].

[1] The Last Word (cafe in front of British Library)
96 Euston Rd, London NW1 2DB
Google maps: https://goo.gl/maps/SbUeExYddSnWPQbz6

[2] The Alan Turing Institute https://www.turing.ac.uk/

It will be casual introductions and chat, though if someone wants to do a
short talk or demo that would be most welcome.

Please register at https://forms.gle/XDvr5gtGKb6K2DXh8 (required for access
to Turing Institute meeting room)

Please let me know if you are interested, even if you can’t confirm
attendance.

Many thanks to Dr James Geddes and The Alan Turing Institute for hosting
this event.

Kind regards,

Stephen

-- 
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/CAGHj7-J3yeioP6QFY_NxEtnnApyi1dW2j5G%2Bm8PuDus4BxC69g%40mail.gmail.com.


Re: [racket-users] [racket users] Generics question

2020-03-03 Thread Kevin Forchione



> On Mar 3, 2020, at 10:48 AM, Jon Zeppieri  wrote:
> 
> On Tue, Mar 3, 2020 at 12:37 PM Kevin Forchione  wrote:
>> 
>> Thanks!  That brings me a little closer in appreciating the comments I’ve 
>> read about replacing object-oriented code with structs and methods.
>> 
>> Is this part of the racket/generic or the Multimethods library? The example 
>> you provide works from racket/generic, but the search in docs pulls up only 
>> the multimethod docs and the examples don’t work from racket/generic.
>> 
>> Kevin
> 
> It's in racket/generic. Here's a link to the documentation for
> `define/generic`:
> https://docs.racket-lang.org/reference/struct-generics.html?q=define%2Fgeneric#%28form._%28%28lib._racket%2Fgeneric..rkt%29._define%2Fgeneric%29%29
> 
> - Jon

Oh, I see. I searched for “define-generic” instead of “define/generic”! Well, 
that explains my confusion and opens up more options as well. :) 

Kevin

-- 
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/5FFB3F9E-0C68-4F6A-B36A-41D496F22103%40gmail.com.


Re: [racket-users] [racket users] Generics question

2020-03-03 Thread Jon Zeppieri
On Tue, Mar 3, 2020 at 12:37 PM Kevin Forchione  wrote:
>
> Thanks!  That brings me a little closer in appreciating the comments I’ve 
> read about replacing object-oriented code with structs and methods.
>
> Is this part of the racket/generic or the Multimethods library? The example 
> you provide works from racket/generic, but the search in docs pulls up only 
> the multimethod docs and the examples don’t work from racket/generic.
>
> Kevin

It's in racket/generic. Here's a link to the documentation for
`define/generic`:
https://docs.racket-lang.org/reference/struct-generics.html?q=define%2Fgeneric#%28form._%28%28lib._racket%2Fgeneric..rkt%29._define%2Fgeneric%29%29

- Jon

-- 
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/CAKfDxxxfSLiqwYof4DaanadssHMTtR2QTJk2Q1nNRzGssoM1zw%40mail.gmail.com.


Re: [racket-users] [racket users] Generics question

2020-03-03 Thread Kevin Forchione


> On Mar 3, 2020, at 9:19 AM, Jon Zeppieri  wrote:
> 
> (struct A (this other) #:transparent
>  #:methods gen:foo
>  [(define/generic generic-foo do-foo)
>   (define (do-foo foo)
> (printf "other=~a ~a"
> (A-this foo)
> (generic-foo (A-other foo])


Thanks!  That brings me a little closer in appreciating the comments I’ve read 
about replacing object-oriented code with structs and methods. 

Is this part of the racket/generic or the Multimethods library? The example you 
provide works from racket/generic, but the search in docs pulls up only the 
multimethod docs and the examples don’t work from racket/generic. 

Kevin

-- 
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/43B656D0-0811-4E15-95FE-8945655AC68A%40gmail.com.


Re: [racket-users] [racket users] Generics question

2020-03-03 Thread Jon Zeppieri
Kevin,

This is what `define/generic` is for. In your example:

On Tue, Mar 3, 2020 at 11:08 AM Kevin Forchione  wrote:
>
> (struct A (this other) #:transparent
>   #:methods gen:foo
>   [(define (do-foo foo)
>  (printf "other=~a ~a"
>  (A-this foo)
>  (do-foo (A-other foo])

The call to `(doo-foo (A-other foo))` is simply a recursive call to
the function that you're in the middle of defining. In order to call
the generic method and have it dispatched appropriately, you need to
use `define/generic`:

(struct A (this other) #:transparent
  #:methods gen:foo
  [(define/generic generic-foo do-foo)
   (define (do-foo foo)
 (printf "other=~a ~a"
 (A-this foo)
 (generic-foo (A-other foo])

- Jon

-- 
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/CAKfDxxzv7S4gnxjZEDT7yD%3Dm8Y4R6t4fCFjFKyixR99r%2Bc15qQ%40mail.gmail.com.


[racket-users] [racket users] Generics question

2020-03-03 Thread Kevin Forchione
Hi guys,
If I create a generic, say foo, for a particular struct and then later 
reference that method on a different type of struct from within the handler 
method I get an error because the call goes to the original structs method and 
not to the method of the other struct. Is there a way to do this?

Here’s a very artificial example:

#lang racket

(require racket/generic)

(define-generics foo
[do-foo foo])

(struct A (this other) #:transparent
  #:methods gen:foo
  [(define (do-foo foo)
 (printf "other=~a ~a"
 (A-this foo)
 (do-foo (A-other foo])
(struct B (lst) #:transparent
  #:methods gen:foo
  [(define (do-foo foo)
 (printf "lst=~a"
 (B-lst foo)))])

(define b (B '(x y z)))
(define a (A 'a b))

(do-foo b) ;=> lst=(x y z)

(do-foo a) ;=> A-this: contract violation
  expected: A?
  given: (B '(x y z))

Thanks, 
Kevin

-- 
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/86CD099C-EC82-4F97-B20A-784933E3C6FC%40gmail.com.