Re: [racket-users] aws package fails against google cloud storage

2016-09-07 Thread 'John Clements' via Racket Users

> On Sep 7, 2016, at 1:02 PM, Sam Tobin-Hochstadt  wrote:
> 
> Isn't there also the option of using the aws pkg at the hash from before the 
> change to v4?

Yes, definitely. (In fact, that’s what I wound up doing, after a git bisect.) I 
might just fork and branch and submit it as a separate pkg to the server.

John

> 
> Sam
> 
> On Wed, Sep 7, 2016 at 3:23 PM 'John Clements' via Racket Users 
>  wrote:
> 
> > On Sep 7, 2016, at 10:48 AM, Tony Garnock-Jones  wrote:
> >
> > On 09/06/2016 02:40 PM, 'John Clements' via Racket Users wrote:
> >> Obvious fixes that I don’t like:
> >>
> >> 1) stop using google cloud storage, starting using Amazon S3.
> >> 2) use the old PLaneT version instead of the shiny new pkg version.
> >>
> >> Any other suggestions?
> >
> > 3) maybe there's a "google API" for GCS?
> 
> Yes, there definitely is. That’s also definitely more work than #2 :).
> 
> >
> > If there is, maybe you can extend or use
> > https://pkgn.racket-lang.org/package/google.
> 
> Ah! didn’t know about this!
> 
> … needs docs, though, and it looks like you don’t have any of the google 
> cloud stuff in there?
> 
> Sigh, always more work to be done.
> 
> John
> 
> 
> 
> --
> 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] aws package fails against google cloud storage

2016-09-07 Thread Sam Tobin-Hochstadt
Isn't there also the option of using the aws pkg at the hash from before
the change to v4?

Sam

On Wed, Sep 7, 2016 at 3:23 PM 'John Clements' via Racket Users <
racket-users@googlegroups.com> wrote:

>
> > On Sep 7, 2016, at 10:48 AM, Tony Garnock-Jones 
> wrote:
> >
> > On 09/06/2016 02:40 PM, 'John Clements' via Racket Users wrote:
> >> Obvious fixes that I don’t like:
> >>
> >> 1) stop using google cloud storage, starting using Amazon S3.
> >> 2) use the old PLaneT version instead of the shiny new pkg version.
> >>
> >> Any other suggestions?
> >
> > 3) maybe there's a "google API" for GCS?
>
> Yes, there definitely is. That’s also definitely more work than #2 :).
>
> >
> > If there is, maybe you can extend or use
> > https://pkgn.racket-lang.org/package/google.
>
> Ah! didn’t know about this!
>
> … needs docs, though, and it looks like you don’t have any of the google
> cloud stuff in there?
>
> Sigh, always more work to be done.
>
> John
>
>
>
> --
> 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] aws package fails against google cloud storage

2016-09-07 Thread 'John Clements' via Racket Users

> On Sep 7, 2016, at 10:48 AM, Tony Garnock-Jones  wrote:
> 
> On 09/06/2016 02:40 PM, 'John Clements' via Racket Users wrote:
>> Obvious fixes that I don’t like:
>> 
>> 1) stop using google cloud storage, starting using Amazon S3.
>> 2) use the old PLaneT version instead of the shiny new pkg version.
>> 
>> Any other suggestions? 
> 
> 3) maybe there's a "google API" for GCS?

Yes, there definitely is. That’s also definitely more work than #2 :).

> 
> If there is, maybe you can extend or use
> https://pkgn.racket-lang.org/package/google.

Ah! didn’t know about this!

… needs docs, though, and it looks like you don’t have any of the google cloud 
stuff in there?

Sigh, always more work to be done.

John



-- 
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] aws package fails against google cloud storage

2016-09-07 Thread Tony Garnock-Jones
On 09/06/2016 02:40 PM, 'John Clements' via Racket Users wrote:
> Obvious fixes that I don’t like:
> 
> 1) stop using google cloud storage, starting using Amazon S3.
> 2) use the old PLaneT version instead of the shiny new pkg version.
> 
> Any other suggestions? 

3) maybe there's a "google API" for GCS?

If there is, maybe you can extend or use
https://pkgn.racket-lang.org/package/google.

(Perhaps https://cloud.google.com/storage/docs/json_api/ is the relevant
API?)

Tony

-- 
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] TR + Hash tables -> chaperone errors ?

2016-09-07 Thread Sam Tobin-Hochstadt
It's not clear what's going on here without seeing more of the code. A
minimal example isn't necessary, just something runnable.

Sam

On Wed, Sep 7, 2016 at 1:31 PM, 'John Clements' via Racket Users
 wrote:
> I’m getting chaperone errors that seem to occur when calling a function 
> defined in TR that uses hash-union to construct hash tables from another file.
>
> Here’s the text of the error:
>
> procedure chaperone: non-chaperone result;
>  received a 2nd argument that is not a chaperone of the original 2nd argument
>   original: '#hash(("storage-mode" . "local") ("db-password" . 
> "captain_teach") ("tar-binary" . "/usr/bin/tar") ("master-user" . 
> "masteru...@example.com") ("cloud-secret-key" . "YOUR-SECRET-KEY") ("db-name" 
> . "captain_teach_testing") ("zip-binary" . "/usr/bin...
>   received: '#hash(("storage-mode" . "local") ("db-password" . 
> "captain_teach") ("tar-binary" . "/usr/bin/tar") ("master-user" . 
> "masteru...@example.com") ("cloud-secret-key" . "YOUR-SECRET-KEY") ("db-name" 
> . "captain_teach_testing") ("zip-binary" . "/usr/bin…
>
> Here’s what I haven’t done:
>
> 1) updated DrRacket from  6.6.0.4--2016-08-29
> 2) tried to minimize the code
>
> … because there’s an easy workaround. However, if anyone’s interested in this 
> bug, I’d be glad to try to zoom in and isolate a small example and submit a 
> PR.
>
> Thanks!
>
> John
>
>
>
> --
> 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] TR + Hash tables -> chaperone errors ?

2016-09-07 Thread 'John Clements' via Racket Users
I’m getting chaperone errors that seem to occur when calling a function defined 
in TR that uses hash-union to construct hash tables from another file.

Here’s the text of the error:

procedure chaperone: non-chaperone result;
 received a 2nd argument that is not a chaperone of the original 2nd argument
  original: '#hash(("storage-mode" . "local") ("db-password" . "captain_teach") 
("tar-binary" . "/usr/bin/tar") ("master-user" . "masteru...@example.com") 
("cloud-secret-key" . "YOUR-SECRET-KEY") ("db-name" . "captain_teach_testing") 
("zip-binary" . "/usr/bin...
  received: '#hash(("storage-mode" . "local") ("db-password" . "captain_teach") 
("tar-binary" . "/usr/bin/tar") ("master-user" . "masteru...@example.com") 
("cloud-secret-key" . "YOUR-SECRET-KEY") ("db-name" . "captain_teach_testing") 
("zip-binary" . "/usr/bin…

Here’s what I haven’t done:

1) updated DrRacket from  6.6.0.4--2016-08-29
2) tried to minimize the code

… because there’s an easy workaround. However, if anyone’s interested in this 
bug, I’d be glad to try to zoom in and isolate a small example and submit a PR.

Thanks!

John



-- 
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: lambda and the equivalent define / "defun"

2016-09-07 Thread Jon Zeppieri
On Wed, Sep 7, 2016 at 12:18 PM, Jon Zeppieri  wrote:

>
> Note that this function still generates a list as output. I suppose it
> could instead generate as many values as there are initial elements of xs,
>


Uh, and you can disregard this statement altogether, since it's crazy
[sorry]. `foldl*`, like `foldl`, does not need to generate a list as output.

-- 
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: lambda and the equivalent define / "defun"

2016-09-07 Thread Jon Zeppieri
On Wed, Sep 7, 2016 at 12:18 PM, Jon Zeppieri  wrote:

>
>
> ```
> #lang racket/base
>
> (require racket/match)
>
> (define (foldl* proc init . xs)
>   (match xs
> ['() init]
> [(cons x xs) (apply foldl* proc (proc x init) xs)]))
> ```
>
>
I should provide an example. So, if you were using the normal `foldl`,
you'd have:

```
> (foldl cons '() '(1 2 3 4))
'(4 3 2 1)
```

Instead, here's you'd do:

```
> (foldl* cons '() 1 2 3 4)
'(4 3 2 1)
 ```

-- 
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: lambda and the equivalent define / "defun"

2016-09-07 Thread Jon Zeppieri
On Wed, Sep 7, 2016 at 11:54 AM, Sanjeev Sharma  wrote:

> Just illustrates the changing structure (increased nesting depth) on each
> recursive call
>
> The initial call to t2 changes the structure of the 
> argument/parameter - it puts in a list where there was no list.
>
> Each recursive call from inside t2 again changes the structure, adding an
> enclosing '() for the  parameter
>
> For the usual (no ) function call It's not an issue for the standard
> car/cdr idiom of walking down recursive structures.
>
>
Okay, I think I follow you.

My first piece of advice (which I think I already mentioned) is to use a
fixed-arity helper function. I understand that you want to do this without
a helper function, but, really, using a helper function is the idiomatic
approach. That said, I'll provide an example of a recursive variable-arity
function that uses `apply` instead. The purpose of `apply` is to use the
individual members of a list as separate arguments to a function call.
Here's a vararg version of `foldl`, limited to a single input "list":

```
#lang racket/base

(require racket/match)

(define (foldl* proc init . xs)
  (match xs
['() init]
[(cons x xs) (apply foldl* proc (proc x init) xs)]))
```

In the recursive case, `apply` is used to provide the elements of xs as
separate arguments to `foldl*`. Note that this function still generates a
list as output. I suppose it could instead generate as many values as there
are initial elements of xs, but that would be an awful pain to use.

- 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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: lambda and the equivalent define / "defun"

2016-09-07 Thread Sanjeev Sharma
Just illustrates the changing structure (increased nesting depth) on each 
recursive call

The initial call to t2 changes the structure of the  argument/parameter - 
it puts in a list where there was no list.

Each recursive call from inside t2 again changes the structure, adding an 
enclosing '() for the  parameter

For the usual (no ) function call It's not an issue for the standard 
car/cdr idiom of walking down recursive structures. 

On Wednesday, September 7, 2016 at 9:28:23 AM UTC-4, Jon Zeppieri wrote:

> On Wed, Sep 7, 2016 at 8:33 AM, Sanjeev Sharma  wrote:
> Thanks for joining in.
> 
> 
> 
> The amended question had nothing to do with the earlier example
> 
> 
> 
> Okay.
>  
> 
> 
> I'm  wondering if there's a quick, standard (and easily understood) idiom 
> (without an internal helper function) to recur on the variable argument list y
> 
> 
> 
> I'm still not sure what you mean, and I don't understand what your `t2` 
> example is supposed to do.
> 
> 
> 
> -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.
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] TR warning with pict3d-canvas% (in pict3d)

2016-09-07 Thread Tim Brown
:-(

Latest nightly "snapshot 6.6.0.4--2016-09-07(42f4784/a)" still throws
the error.

Tim

On 07/09/16 15:37, Sam Tobin-Hochstadt wrote:
> I think this is fixed in the git repository. Can you try a snapshot build and 
> see if that works?
> 
> Sam
> 
> On Wed, Sep 7, 2016 at 10:35 AM Tim Brown  > wrote:
> 
> Folks (Neil?),
> 
> Another type issue, but this time with pict3d.
> I am trying to use the following code to display a sphere.
> But there seems to be an issue throwing up a warning. A warning
> that “will become an error in a future release”. A warning that
> also seems to be using up a lot of juice to print itself out.
> 
> Has anyone any idea where to improve the type declarations to
> suppress this?
> 
> ;;
> #lang typed/racket/gui
> (require pict3d)
> 
> (define f (new frame% [label "T"] [width 400] [height 400]))
> 
> (new pict3d-canvas% [parent f] [pict3d (sphere origin 1/2)])
> 
> (send f show #t)
> ;;
> 
> Generates numerous errors of the form:
> 
> cpointer?: contract violation
>   any-wrap/c: Unable to protect opaque value passed as `Any`
>   value: #
>   This warning will become an error in a future release.
>   in: the 1st argument of
>   a part of the or/c of
>   (or/c
>struct-predicate-procedure?/c
>(-> Any boolean?))
>   contract from: (interface for cpointer?)
>   blaming: /pict3d/typed/opengl/ffi-types.rkt
>(assuming the contract is correct)
>   at: /pict3d/typed/opengl/ffi-types.rkt:19.20
> 
> 
> ffi-types.rkt:19 is:
>  ..
>  17  (require/typed
>  18   ffi/unsafe
> *19   [#:opaque CPointer cpointer?]  ; includes Bytes and other things 
> that can be used as cpointers
>  20   [#:opaque CType ctype?]
>  21   )
>  ..
> which seems perfectly innocuous to me :-/
> 
> Tim
> 
> --
> Tim Brown CEng MBCS >
> 
> City Computing Limited · www.cityc.co.uk 
> 
>   City House · Sutton Park Rd · Sutton · Surrey · SM1 2AE · GB
> T:+44 20 8770 2110 · F:+44 20 8770 2130
> 
> City Computing Limited registered in London No:1767817.
> Registered Office: City House, Sutton Park Road, Sutton, Surrey, SM1 2AE
> VAT No: GB 918 4680 96
> 
> --
> 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 Brown CEng MBCS 

City Computing Limited · www.cityc.co.uk
  City House · Sutton Park Rd · Sutton · Surrey · SM1 2AE · GB
T:+44 20 8770 2110 · F:+44 20 8770 2130

City Computing Limited registered in London No:1767817.
Registered Office: City House, Sutton Park Road, Sutton, Surrey, SM1 2AE
VAT No: GB 918 4680 96

-- 
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] TR warning with pict3d-canvas% (in pict3d)

2016-09-07 Thread Tim Brown
Folks (Neil?),

Another type issue, but this time with pict3d.
I am trying to use the following code to display a sphere.
But there seems to be an issue throwing up a warning. A warning
that “will become an error in a future release”. A warning that
also seems to be using up a lot of juice to print itself out.

Has anyone any idea where to improve the type declarations to
suppress this?

;;
#lang typed/racket/gui
(require pict3d)

(define f (new frame% [label "T"] [width 400] [height 400]))

(new pict3d-canvas% [parent f] [pict3d (sphere origin 1/2)])

(send f show #t)
;;

Generates numerous errors of the form:

cpointer?: contract violation
  any-wrap/c: Unable to protect opaque value passed as `Any`
  value: #
  This warning will become an error in a future release.
  in: the 1st argument of
  a part of the or/c of
  (or/c
   struct-predicate-procedure?/c
   (-> Any boolean?))
  contract from: (interface for cpointer?)
  blaming: /pict3d/typed/opengl/ffi-types.rkt
   (assuming the contract is correct)
  at: /pict3d/typed/opengl/ffi-types.rkt:19.20


ffi-types.rkt:19 is:
 ..
 17  (require/typed
 18   ffi/unsafe
*19   [#:opaque CPointer cpointer?]  ; includes Bytes and other things that can 
be used as cpointers
 20   [#:opaque CType ctype?]
 21   )
 ..
which seems perfectly innocuous to me :-/

Tim

-- 
Tim Brown CEng MBCS 

City Computing Limited · www.cityc.co.uk
  City House · Sutton Park Rd · Sutton · Surrey · SM1 2AE · GB
T:+44 20 8770 2110 · F:+44 20 8770 2130

City Computing Limited registered in London No:1767817.
Registered Office: City House, Sutton Park Road, Sutton, Surrey, SM1 2AE
VAT No: GB 918 4680 96

-- 
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: lambda and the equivalent define / "defun"

2016-09-07 Thread Jon Zeppieri
On Wed, Sep 7, 2016 at 8:33 AM, Sanjeev Sharma  wrote:

> Thanks for joining in.
>
> The amended question had nothing to do with the earlier example
>

Okay.


>
> I'm  wondering if there's a quick, standard (and easily understood) idiom
> (without an internal helper function) to recur on the variable argument
> list y
>

I'm still not sure what you mean, and I don't understand what your `t2`
example is supposed to do.

-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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] typed/racket/gui : possible bug in slider%.get-value

2016-09-07 Thread Sam Tobin-Hochstadt
Thanks for noticing this! The type of `get-value` was wrong, probably
due to reading `position-integer?` in the docs as `positive-integer?`,
or something like that. I'll push a repair.

Sam

On Wed, Sep 7, 2016 at 7:47 AM, Tim Brown  wrote:
> The following code produces a contract error; I think TR is making
> assumptions that it probably shouldn’t be.
>
> Please could someone investigate.
>
> Thanks,
>
> Tim
>
> ;;;
> #lang typed/racket/gui
> (define f (new frame% [label "Frame"]))
> (define sldr
>(new slider%
> [parent f]
> [max-value 0]
> [min-value -1]
> [init-value 0]
> [callback (λ (sldr cntrl-evnt)
> (displayln (get-v)))]
> [label (format "It's false if negative")]))
>
> (define (get-v) : (Option Index)
>   (define v (send sldr get-value))
>   (printf "~s ~s ~s~%" v (negative? v) (if (negative? v) #f v))
>   (if (negative? v)
>   #f
>   (cast v Index)))
>
> (send f show #t)
> (send sldr set-value -1)
> (get-v)
> ;;;
>
> Runtime error is:
> --
> broke its own contract
>   promised: Index
>   produced: -1
>   in: Index
>   contract from: cast
>   blaming: cast
>(assuming the contract is correct)
>   at: unsaved-editor:18.6
> --
>
> --
> Tim Brown CEng MBCS 
> 
> City Computing Limited · www.cityc.co.uk
>   City House · Sutton Park Rd · Sutton · Surrey · SM1 2AE · GB
> T:+44 20 8770 2110 · F:+44 20 8770 2130
> 
> City Computing Limited registered in London No:1767817.
> Registered Office: City House, Sutton Park Road, Sutton, Surrey, SM1 2AE
> VAT No: GB 918 4680 96
>
> --
> 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] Re: lambda and the equivalent define / "defun"

2016-09-07 Thread Sanjeev Sharma
Thanks for joining in.

The amended question had nothing to do with the earlier example

I'm  wondering if there's a quick, standard (and easily understood) idiom 
(without an internal helper function) to recur on the variable argument list y

The flatten's not ideal - I may want to retain some sub-list structure 

(define x 4)
(define t2
  (lambda y
(let ((z (car y)))
  (display y)(newline)
  (display (flatten y))(newline)
  (display z)(newline)
  (if (> x 0)
  (begin
(set! x (- x 1))
;(t2 (cdr y)))
(t2 y))
  (void)
(t2 1 2 3 4 5 6)



RETURNS
(1 2 3 4 5 6)
(1 2 3 4 5 6)
1
((1 2 3 4 5 6))
(1 2 3 4 5 6)
(1 2 3 4 5 6)
(((1 2 3 4 5 6)))
(1 2 3 4 5 6)
((1 2 3 4 5 6))
1 2 3 4 5 6
(1 2 3 4 5 6)
(((1 2 3 4 5 6)))
(1 2 3 4 5 6)
(1 2 3 4 5 6)
1 2 3 4 5 6


On Tuesday, September 6, 2016 at 9:04:07 PM UTC-4, Jon Zeppieri wrote:
> On Tue, Sep 6, 2016 at 8:50 PM, Jon Zeppieri  wrote:
>  
> The `(lambda s ...)` is variable-arity, but when you call `ss` internally 
> [...]
> 
> 
> Sorry, I realized after that your `ss` function essentially *is* a wrapper 
> around your `subsets` function -- which is exactly what I was suggesting. 
> However, there's no reason for it to duplicate so much of the work of 
> `subsets`. Since `subsets` works on any list, your definition of `ss` can 
> simply be:
> 
> 
> (define (ss . xs) (subsets xs))
> 
> 
> The only purpose of `ss` is to package up its arguments as a list and pass 
> that list to `subsets`.
> 
> 
> - 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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] typed/racket/gui : possible bug in slider%.get-value

2016-09-07 Thread Tim Brown
The following code produces a contract error; I think TR is making
assumptions that it probably shouldn’t be.

Please could someone investigate.

Thanks,

Tim

;;;
#lang typed/racket/gui
(define f (new frame% [label "Frame"]))
(define sldr
   (new slider%
[parent f]
[max-value 0]
[min-value -1]
[init-value 0]
[callback (λ (sldr cntrl-evnt)
(displayln (get-v)))]
[label (format "It's false if negative")]))

(define (get-v) : (Option Index)
  (define v (send sldr get-value))
  (printf "~s ~s ~s~%" v (negative? v) (if (negative? v) #f v))
  (if (negative? v)
  #f
  (cast v Index)))

(send f show #t)
(send sldr set-value -1)
(get-v)
;;;

Runtime error is:
--
broke its own contract
  promised: Index
  produced: -1
  in: Index
  contract from: cast
  blaming: cast
   (assuming the contract is correct)
  at: unsaved-editor:18.6
--

-- 
Tim Brown CEng MBCS 

City Computing Limited · www.cityc.co.uk
  City House · Sutton Park Rd · Sutton · Surrey · SM1 2AE · GB
T:+44 20 8770 2110 · F:+44 20 8770 2130

City Computing Limited registered in London No:1767817.
Registered Office: City House, Sutton Park Road, Sutton, Surrey, SM1 2AE
VAT No: GB 918 4680 96

-- 
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] Racket module creation in org-mode?

2016-09-07 Thread Stephen De Gabrielle
Sorry, I'm not sure I understand what you mean.

You can use the module form to define more than one module in a file.
There is also the sub-modules functionality.

Both are documented at
https://docs.racket-lang.org/guide/Module_Syntax.html#%28part._module-syntax%29

Kind regards
Stephen
On Tue, 6 Sep 2016 at 19:59, Lawrence Bottorff  wrote:

> Just wondering if creating a module always has to be based on a .rkt file?
> Would there be any way to create, say, modules (one or more) in an org-mode
> file, perhaps one module per babel code block? . . . Trying to get org-mode
> to be more "modular."
>
> --
> 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.
>
-- 
Kind regards,
Stephen
--
Bigger than Scheme, cooler than Clojure & more fun than CL.(n=1)
--

-- 
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] aws package fails against google cloud storage

2016-09-07 Thread 'John Clements' via Racket Users

> On Sep 6, 2016, at 5:42 PM, Greg Hendershott  
> wrote:
> 
> Until this thread today, I wasn't even aware the AWS package could be
> used with GCS.
> 
> It was a fair amount of work to update things to use v4 sig a year ago:
> 
>  https://github.com/greghendershott/aws/milestone/5?closed=1
> 
> If only I'd known, I could have used GCS compatibility as an excuse
> not to do that. ;)
> 
> Seriously, IIUC the issue is that newer AWS data centers don't even
> support v2 sig anymore. One of the few users of the AWS package that I
> know of had requested v4 so they could use Frankfurt.
> 
> 
> By the way, I myself am not an active user of this package. Originally
> I undertook it as one of the
> suggested-ways-people-could-help-with-Racket. Although I've had
> limited time lately, I'm happy to maintain it. Having said that I'd
> welcome any active user who wanted to do more with it than I current
> have time to do.

Sounds like the right thing to do might be to make a branch and offer it as a 
different racket package. If I have time (somewhat unlikely), I’ll fork this 
repo and do that. Many thanks for all your hard work!

John


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


signature.asc
Description: PGP signature