Re: [racket] Package conflict while attempting to install Whalesong

2014-06-29 Thread Matthew Flatt
At Sun, 29 Jun 2014 19:26:56 -0600, Jay McCarthy wrote: > Hi Jens, > > On Sun, Jun 29, 2014 at 8:39 AM, Jens Axel Søgaard > wrote: > > The error is as follows: > > > > ./raco pkg install git://github.com/dyoo/whalesong.git > > Querying GitHub branches > > > > Using cached14040514811404051481611 f

Re: [racket] Questions from a new user

2014-06-29 Thread Laurent
On Sun, Jun 29, 2014 at 3:52 PM, Jens Axel Søgaard wrote: > Hi Hendrik, > > Here is a blog post from 2012 about Racket on Android: > http://www.wedesoft.de/racket-on-android.html This proves that it is possible to get it running on Android. > It mentions that Racket is slow to load, due to t

Re: [racket] Package conflict while attempting to install Whalesong

2014-06-29 Thread Danny Yoo
Hi Jens and Jay, My apologies! I have not been following with recent Racket development at all. I don't know what the current state of the Racket packaging system is. I don't know what I should be doing to fix this, and I don't have time unfortunately to really start learning the new packaging

Re: [racket] Contract for function with vararg

2014-06-29 Thread Robby Findler
Yes, I believe this is what you want: #lang racket (define (chaperone-f f) (chaperone-procedure f (λ (fst . more) (printf "fst arg: ~s\n" fst) (apply values fst more ((chaperone-f (λ (x y) x)) 1 2) ((chaperone-f (λ (x y z) x)) 1 2 3) ((chaperone-f (λ (x y z w) x)) 1 2 3 4)

Re: [racket] Contract for function with vararg

2014-06-29 Thread Alexander D. Knauth
On Jun 29, 2014, at 8:44 PM, Roman Klochkov wrote: > > procedure-has-arity is not needed. I can write: > > (define/contract (test f) (-> (or/c > (-> input-port? any/c any) > (-> input-port? any/c any/c any) >

Re: [racket] Package conflict while attempting to install Whalesong

2014-06-29 Thread Jay McCarthy
Hi Jens, On Sun, Jun 29, 2014 at 8:39 AM, Jens Axel Søgaard wrote: > Hi All, > > I am attempting to install the git version of Whalesong. > There is a conflict with already existing installed module - but which one? > I can't see anything relevant in the lists that raco planet show and > raco pkg

Re: [racket] Contract for function with vararg

2014-06-29 Thread Robby Findler
On Sun, Jun 29, 2014 at 7:44 PM, Roman Klochkov wrote: > 2Robby: > >> (define/contract (test f) (-> (->* (input-port? any/c) #:rest list? any) >> any) > 1) >> (test (λ (x y) 2)) > . . test: contract violation > expected: a procedure that accepts 2 non-keyword arguments and arbitrarily > many

Re: [racket] Contract for function with vararg

2014-06-29 Thread Roman Klochkov
I reformulate my problem: I need to make a chaperone, that checks only type of first arg. Is it possible? If yes, I'll sumply make something like (define (arity>=/c x)     (λ (proc)   (define arity (normalize-arity (procedure-arity proc)))   (define max-arity     (if (list? arity) (c

Re: [racket] Contract for function with vararg

2014-06-29 Thread Roman Klochkov
2Robby: > (define/contract (test f) (-> (->* (input-port? any/c) #:rest list? any) any)     1) > (test (λ (x y) 2)) . . test: contract violation   expected: a procedure that accepts 2 non-keyword arguments and arbitrarily many more   given: #   accepts: 2 arguments   in: the 1st argument of

Re: [racket] Contract for function with vararg

2014-06-29 Thread Robby Findler
Why isn't: (->* (input-port? any/c) #:rest list? any) by itself the contract that you want? Robby On Sun, Jun 29, 2014 at 12:08 PM, Alexander D. Knauth wrote: > You can use or/c to do this, as long as you guard them like this so that no > more than one contract matches at a time: > (or/c >

Re: [racket] FW: q about code for partitions

2014-06-29 Thread Vincent St-Amour
Ah, that explains it. Thanks! Vincent At Sun, 29 Jun 2014 12:32:48 -0700, Eric Dobson wrote: > > Vincent: exact-zero? is defined through 'make-predicate' which uses > contract machinery to generate the function. I filed a couple of bugs > tracking some of the slowness issues. There is no `contr

Re: [racket] FW: q about code for partitions

2014-06-29 Thread Eric Dobson
Vincent: exact-zero? is defined through 'make-predicate' which uses contract machinery to generate the function. I filed a couple of bugs tracking some of the slowness issues. There is no `contract` form though so I doubt that the coach will find it. http://bugs.racket-lang.org/query/?cmd=view%20a

Re: [racket] FW: q about code for partitions

2014-06-29 Thread Jos Koot
Great work, Jens. I am glad my approach as been adopted (and much improved without deviating from the original idea of simpler recurrence). When can we expect it in the next nightly build? Thanks, Jos > -Original Message- > From: jensaxelsoega...@gmail.com > [mailto:jensaxelsoega...@gmai

Re: [racket] Regex golf: 25x slowdown compared to Python?!

2014-06-29 Thread Vincent St-Amour
FYI, I just updated Optimization Coach to report when you pass non-regexp-valued patterns to regexp functions. Thanks for the report! Vincent At Thu, 26 Jun 2014 20:03:37 +0200, Laurent wrote: > > Oh woah! Thank you very much Matthew! What a relief :) > > I thought I had tried that, but looks

Re: [racket] FW: q about code for partitions

2014-06-29 Thread Vincent St-Amour
Given that partitions2.rkt is written in TR, it shouldn't have to go through a contract boundary to use `exact-zero?` (which is also written in TR). The contract profiler does not observe any time spent in contracts, which supports that hypothesis. How did you discover that `exact-zero?` was wrapp

Re: [racket] Contract for function with vararg

2014-06-29 Thread Alexander D. Knauth
You can use or/c to do this, as long as you guard them like this so that no more than one contract matches at a time: (or/c (and/c (procedure-has-arity/c 2) (-> input-port? any/c any)) (and/c (procedure-has-arity/c 3) (-> input-port? any/c any/c any)) (and/c (procedure-has-arity/c 4) (-> input-

Re: [racket] Questions from a new user

2014-06-29 Thread jsgraha...@yahoo.com
Actually I was thinking of Ganbit-C Scheme myself.  Various indivivuals have ported the Gambit development system, 1 or more games and medical device apps to run on Android and/or iPhones. Personally i'd be just as happy using Racket on those platforms.  Is there a way to do so? Steve Sent fr

[racket] Package conflict while attempting to install Whalesong

2014-06-29 Thread Jens Axel Søgaard
Hi All, I am attempting to install the git version of Whalesong. There is a conflict with already existing installed module - but which one? I can't see anything relevant in the lists that raco planet show and raco pkg show --all produce. Any hints? /Jens Axel The error is as follows: ./raco p

Re: [racket] Questions from a new user

2014-06-29 Thread Neil Van Dyke
In addition to various ways of running a Racket VM on Android/iOS/etc. devices, another way to use Racket in mobile device app development is to target HTML5 offline apps. This means dynamic HTML+CSS UI, offline application cache and updating, persistent local storage, etc. A client of mine h

Re: [racket] Questions from a new user

2014-06-29 Thread Jens Axel Søgaard
Hi Hendrik, Here is a blog post from 2012 about Racket on Android: http://www.wedesoft.de/racket-on-android.html This proves that it is possible to get it running on Android. It mentions that Racket is slow to load, due to the large runtime. The version used was 5.2 and in the mean time versi

Re: [racket] Questions from a new user

2014-06-29 Thread Hendrik Boom
On Sat, Jun 28, 2014 at 11:10:17PM -0700, Steve Graham wrote: > I have been interested in the Lisp family of languages for a while.  My short > term reason for studying the book is to get a handle on Scheme for > programming on the Android platform. Has Racket been implemented on Android? I kno

Re: [racket] FW: q about code for partitions

2014-06-29 Thread Robby Findler
This seems like a good test case for Vincent's tools. They may have been able to tell us that the time was spent contract checking. Robby On Sun, Jun 29, 2014 at 5:48 AM, Jens Axel Søgaard wrote: > I have made a new vector version using zero? instead of exact-zero?. > > To give users a chance t

[racket] Contract for function with vararg

2014-06-29 Thread Roman Klochkov
How to make a contract, that accepts (-> input-port? any/c any) (-> input-port? any/c any/c any) (-> input-port? any/c any/c any/c any) ... and (->* (input-port? any/c) #:rest list? any) So theare should be at least two args and first arg should be input-port. -- Roman Klochkov

Re: [racket] FW: q about code for partitions

2014-06-29 Thread Jens Axel Søgaard
I have made a new vector version using zero? instead of exact-zero?. To give users a chance to remove the cache after doing partitions calculations, I have added set-partitions-cache. Code: https://github.com/soegaard/racket/blob/patch-14/pkgs/math-pkgs/math-lib/math/private/number-theory/

Re: [racket] FW: q about code for partitions

2014-06-29 Thread Jens Axel Søgaard
2014-06-29 8:47 GMT+02:00 Matthew Flatt : > It looks like "partitions2.rkt" ends up calling a contract-wrapped > variant of `exact-zero?`. That explains why Eric saw an improvement, when the used #f instead of 0 as the not-cached-yet value. /Jens Axel Racket Users list: h

Re: [racket] Improvement of a syntax-parse syntax class definition

2014-06-29 Thread Jens Axel Søgaard
Hi Alexander, That's a very nice solution! Now we just need to lobby for pattern expanders to appear in the official syntax-parse! /Jens Axel 2014-06-27 5:55 GMT+02:00 Alexander D. Knauth : > Well, I made my own modified version of syntax/parse that lets you define > ~separated as a pattern-e

Re: [racket] FW: q about code for partitions

2014-06-29 Thread Jos Koot
I timed a version unrolling the loops for even and odd k. I see no speed up. Just to let you know. Jos > -Original Message- > From: Matthew Flatt [mailto:mfl...@cs.utah.edu] > Sent: domingo, 29 de junio de 2014 8:47 > To: Jens Axel Søgaard > Cc: Jos Koot; Racket Users List > Subject: Re: