Re: [racket-dev] typed/racket for loops?

2011-06-07 Thread Hari Prashanth
Its a bad error message I believe.

(: p (Listof Fixnum))
(define p 
  (for/list: : (Listof Fixnum) ([i : Fixnum (in-range 30)]) i))


- Original Message -
From: "John Clements" 
To: "Sam Tobin-Hochstadt" 
Cc: "dev" 
Sent: Tuesday, June 7, 2011 3:10:58 PM (GMT-0500) Auto-Detected
Subject: [racket-dev] typed/racket for loops?

I can't get typed racket to work with for loops, e.g.:

#lang typed/racket

(: p (Listof Natural))
(define p 
  (for/list: : Natural ([i (in-range 30)]) i))

==> Type Checker: Error in macro expansion -- untyped variable: for-loop in: 
(for/list: : Natural ((i (in-range 30))) i)


Am I doing something silly here? I tried annotating the type of the loop 
variable 'i', with no change in the error message.

John


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Can someone tell whats wrong with this?

2011-02-25 Thread Hari Prashanth
No its unlimited...

- Original Message -
From: "Matthew Flatt" 
To: "Hari Prashanth" 
Cc: "PLT Developers" 
Sent: Friday, February 25, 2011 8:33:20 PM GMT -05:00 US/Canada Eastern
Subject: Re: [racket-dev] Can someone tell whats wrong with this?

Do you have a `vmemoryuse' limit set?

At Fri, 25 Feb 2011 19:29:17 -0500 (EST), Hari Prashanth wrote:
> The program is killed when the call to `collect' inside for loop is 
> commented... I am using a fairly recent version of Racket...
> 
> #lang racket/load
> 
> (module RACKETSET racket/base
> 
>   (require (prefix-in rk: racket/set))
> 
>   (define list1 (build-list 100 add1))
>   (define list2 (build-list 100 (λ (x) (+ x 100
>   
>   (define set1 (apply rk:set list1))
>   (define set2 (apply rk:set list2))
> 
>   (display "Racket sets\n")
>   (define (collect)
> (collect-garbage)
> (collect-garbage)
> (collect-garbage))
>   
>   (collect)
>   (define sets
> (for ([i (in-range 10)])
>   (time (rk:set-union set1 set2))
>   #;(collect
> 
> swamiji@ubuntu:~/Desktop/krhari/TS$ raco make set-benchmark.rkt
> swamiji@ubuntu:~/Desktop/krhari/TS$ racket set-benchmark.rkt
> Racket sets
> cpu time: 5800 real time: 5810 gc time: 520
> cpu time: 6670 real time: 7041 gc time: 1390
> cpu time: 5890 real time: 10478 gc time: 620
> Killed
> swamiji@ubuntu:~/Desktop/krhari/TS$
> 
> _
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/dev

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

[racket-dev] Can someone tell whats wrong with this?

2011-02-25 Thread Hari Prashanth
The program is killed when the call to `collect' inside for loop is 
commented... I am using a fairly recent version of Racket...

#lang racket/load

(module RACKETSET racket/base

  (require (prefix-in rk: racket/set))

  (define list1 (build-list 100 add1))
  (define list2 (build-list 100 (λ (x) (+ x 100
  
  (define set1 (apply rk:set list1))
  (define set2 (apply rk:set list2))

  (display "Racket sets\n")
  (define (collect)
(collect-garbage)
(collect-garbage)
(collect-garbage))
  
  (collect)
  (define sets
(for ([i (in-range 10)])
  (time (rk:set-union set1 set2))
  #;(collect

swamiji@ubuntu:~/Desktop/krhari/TS$ raco make set-benchmark.rkt
swamiji@ubuntu:~/Desktop/krhari/TS$ racket set-benchmark.rkt
Racket sets
cpu time: 5800 real time: 5810 gc time: 520
cpu time: 6670 real time: 7041 gc time: 1390
cpu time: 5890 real time: 10478 gc time: 620
Killed
swamiji@ubuntu:~/Desktop/krhari/TS$

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Re: [racket-dev] F1 on latest release

2010-10-20 Thread Hari Prashanth
I have seen this before... If I remember correctly, it happened after 
using "raco fileinject" and "raco remove" several times... I just 
removed .racket directory and it went away... I could not reproduce 
the problem, so I did not report it...

Hari

- Original Message -
From: "Matthias Felleisen" 
To: "plt-dev Developers" 
Sent: Wednesday, October 20, 2010 11:22:35 PM GMT -05:00 US/Canada Eastern
Subject: [racket-dev] F1 on latest release


F1 doesn't work on a recent git: 

browser-run: process execute failed: '(# "-e" "open 
location 
\"file:///Users/matthias/Library/Racket/5.0.1.8/doc/search/search-context.html?q=read-html&hq=O%3A%7B%20L%3Alang%2Fhtdp-beginner-abbr%20T%3Ateachpack%20%7D&label=Beginning%20Student%20with%20List%20Abbrev...

Anyone else with this problem? 
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Bug? identifier `make-Int' not included in nested require spec.

2010-10-04 Thread Hari Prashanth
Ok it does work...

Thanks
Hari

- Original Message -
From: "Sam Tobin-Hochstadt" 
To: "Hari Prashanth" 
Cc: "dev" 
Sent: Monday, October 4, 2010 7:16:26 PM GMT -05:00 US/Canada Eastern
Subject: Re: [racket-dev] Bug? identifier `make-Int' not included in nested 
require spec.

This is a known bug with the interaction of `struct' and
`require/typed'.  `define-struct' should work here.

On Mon, Oct 4, 2010 at 7:11 PM, Hari Prashanth  wrote:
> Am I doing some thing wrong or is it a bug?
>
> #lang racket/load
>
> (module UNTYPED racket/base
>  (struct Int (elem))
>
>  (provide (struct-out Int)))
>
> (module TYPED typed/racket
>  (require/typed 'UNTYPED
>                 [struct Int ([elem  : Integer])]))
>
> I get the following error
>
> only-in: identifier `make-Int' not included in nested require spec in: (quote 
> UNTYPED)
>
> Hari
> _
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev
>



-- 
sam th
sa...@ccs.neu.edu
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

[racket-dev] Bug? identifier `make-Int' not included in nested require spec.

2010-10-04 Thread Hari Prashanth
Am I doing some thing wrong or is it a bug?

#lang racket/load

(module UNTYPED racket/base
  (struct Int (elem))
  
  (provide (struct-out Int)))

(module TYPED typed/racket
  (require/typed 'UNTYPED
 [struct Int ([elem  : Integer])]))

I get the following error

only-in: identifier `make-Int' not included in nested require spec in: (quote 
UNTYPED)

Hari
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] typed/scheme n00b question

2010-09-05 Thread Hari Prashanth
Since secs and and fail-thunk are optional, we need to use case lambda for 
writhing
the type.

(require/typed racket/base
   [file-or-directory-modify-seconds 
(case-lambda
  [String -> (U Integer Void exn:fail:filesystem)]
  [String (-> exn:fail:filesystem) -> (U Integer Void 
exn:fail:filesystem)]
  [String (Option Integer) (-> exn:fail:filesystem) 
  -> 
  (U Integer Void exn:fail:filesystem)])])


* If we do not have exn:fail:filesystem, it will raise a contract-broken error 
when 
fail-thunk raises an exception. So I added exn:fail:filesystem.

So how can I have the exception and not the contract error?


Hari


- Original Message -
From: "Shriram Krishnamurthi" 
To: "Sam Tobin-Hochstadt" 
Cc: "Hari Prashanth" , "plt-dev Developers" 

Sent: Sunday, September 5, 2010 9:59:32 AM GMT -05:00 US/Canada Eastern
Subject: Re: [racket-dev] typed/scheme n00b question

Can you tell us (om the list) what the true type is?  I'm sure I'm not
the only one curious as to precisely what it is and how you would
write it w/ the exception.  Thanks.

Shriram

On Sun, Sep 5, 2010 at 8:57 AM, Sam Tobin-Hochstadt  wrote:
> On Sun, Sep 5, 2010 at 3:06 AM, Hari Prashanth  wrote:
>> Is this what you are looking for?
>>
>> (require/typed racket/base
>>               [file-or-directory-modify-seconds
>>                (String (Option Integer) (-> exn:fail:filesystem) -> (U 
>> Integer Void))])
>
> Hari is correct that you can use `require/typed' on `racket/base'.
> However, that type isn't quite right - it shouldn't *return*
> `exn:fail:filesystem' - that is an exception that might be raised.
>
> The true type is more complex; I'll add it to the base environment.
> --
> sam th
> sa...@ccs.neu.edu
> _
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev
>
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Re: [racket-dev] typed/scheme n00b question

2010-09-05 Thread Hari Prashanth
Sorry.. The return type should be (U Integer Void exn:fail:filesystem)


- Original Message -
From: "Hari Prashanth" 
To: "John Clements" 
Cc: "plt-dev Developers" 
Sent: Sunday, September 5, 2010 3:06:49 AM GMT -05:00 US/Canada Eastern
Subject: Re: [racket-dev] typed/scheme n00b question

Is this what you are looking for? 

(require/typed racket/base
   [file-or-directory-modify-seconds 
(String (Option Integer) (-> exn:fail:filesystem) -> (U Integer 
Void))])


Hari

- Original Message -
From: "John Clements" 
To: "plt-dev Developers" 
Sent: Sunday, September 5, 2010 1:44:17 AM GMT -05:00 US/Canada Eastern
Subject: [racket-dev] typed/scheme n00b question

I'd like to write a typed/racket or typed/racket/base program that uses 
"file-or-directory-modify-seconds". I get this error:

Type Checker: untyped identifier file-or-directory-modify-seconds imported from 
module  in: file-or-directory-modify-seconds

If this function were acquired using a 'require', I see that I could use 
'require/typed' to associate a type with it.  I don't see how to apply this to 
functions that come in as part of the language.

I tried various decorations to wrap the use of the function in checks, but then 
realized that the type checker wasn't complaining that the value had the 'Any' 
type, but instead that the value was untyped, which suggests that type-futzing 
(checking that it's a procedure, etc.) was unlikely to help.

What's the (presumably obvious?) solution to this?

John


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] typed/scheme n00b question

2010-09-05 Thread Hari Prashanth
Is this what you are looking for? 

(require/typed racket/base
   [file-or-directory-modify-seconds 
(String (Option Integer) (-> exn:fail:filesystem) -> (U Integer 
Void))])


Hari

- Original Message -
From: "John Clements" 
To: "plt-dev Developers" 
Sent: Sunday, September 5, 2010 1:44:17 AM GMT -05:00 US/Canada Eastern
Subject: [racket-dev] typed/scheme n00b question

I'd like to write a typed/racket or typed/racket/base program that uses 
"file-or-directory-modify-seconds". I get this error:

Type Checker: untyped identifier file-or-directory-modify-seconds imported from 
module  in: file-or-directory-modify-seconds

If this function were acquired using a 'require', I see that I could use 
'require/typed' to associate a type with it.  I don't see how to apply this to 
functions that come in as part of the language.

I tried various decorations to wrap the use of the function in checks, but then 
realized that the type checker wasn't complaining that the value had the 'Any' 
type, but instead that the value was untyped, which suggests that type-futzing 
(checking that it's a procedure, etc.) was unlikely to help.

What's the (presumably obvious?) solution to this?

John


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Problem with GC or with my machine?

2010-09-03 Thread Hari Prashanth
Yes the problem goes away once I turn off the optimizer... I have attached 
the code.

#lang typed/racket
(require "que.ss")
(head (queue 1 2 3 4))

 
- Original Message -
From: "Vincent St-Amour" 
To: "Matthew Flatt" 
Cc: "Hari Prashanth" , "dev" 
Sent: Friday, September 3, 2010 11:39:50 AM GMT -05:00 US/Canada Eastern
Subject: Re: [racket-dev] Problem with GC or with my machine?

At Fri, 3 Sep 2010 09:34:10 -0600,
Matthew Flatt wrote:
> Thanks for sending the code. I see that it's using Typed Racket with
> #:optimize. Maybe Vincent and Sam should take a look to make sure that
> the optimizer isn't generating incorrect unsafe code?

Yes, please send us the code.

First thing you should try, though, is turn off the optimizer and see
if the problem goes away.

Vincent


que.ss
Description: Binary data
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

[racket-dev] Problem with GC or with my machine?

2010-09-02 Thread Hari Prashanth
I am getting the following error... And this is the only message I get...

SIGSEGV MAPERR si_code 1 fault on addr 0xfffc
This often means 0xfffc isn't getting marked, and was prematurely 
freed
Aborted

What does it mean? Has anyone seen this?

If you want to take a look at the code that is causing this, let me know.

Hari

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] source distribution problems

2010-08-06 Thread Hari Prashanth

I just built plt-src-unix.tgz. I looks good. I didn't see any errors.
I built it on Ubuntu 10.04.

Hari

- Original Message -
From: "Eli Barzilay" 
To: "Matthew Flatt" 
Cc: dev@racket-lang.org
Sent: Friday, August 6, 2010 9:49:17 PM GMT -05:00 US/Canada Eastern
Subject: Re: [racket-dev] source distribution problems

On Aug  5, Matthew Flatt wrote:
> We need to add "build on Linux from source distribution" to our
> release-time checklist. Kevin, can we put that under your name?

Added, but with Jon (who volunteered) -- also, he'll check the binary
installer in both modes (which would catch the previous README
problem).


> I think we should also fix the 5.0.1 source bundles. Eli, would that be
> reasonable?

I've re-packaged them for all platforms (for windows too, even though
the only change is the unused utils directory).  The results are at
http://tmp.barzilay.org/src/ -- can someone who is not running to
catch a plane test them?

-- 
  ((lambda (x) (x x)) (lambda (x) (x x)))  Eli Barzilay:
http://barzilay.org/   Maze is Life!
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] P4P: A Syntax Proposal

2010-07-28 Thread Hari Prashanth

I have heard students saying that they did not like Scheme syntax/parans 
even after using it for a whole semester. I really, to this day, haven't 
understood why they did not like parans. But given an option some people
might start liking it/using it. I feel it would be a great idea to have 
P4P as an alternate. 

Hari

- Original Message -
From: "Neil Van Dyke" 
To: "Jos Koot" 
Cc: "PLT Developers" 
Sent: Wednesday, July 28, 2010 4:44:51 PM GMT -05:00 US/Canada Eastern
Subject: Re: [racket-dev] P4P: A Syntax Proposal

Jos Koot wrote at 07/28/2010 04:00 PM:
> With a good editor, like that of DrSceme, pardon me, RdRacket, I experience 
> no difficulty at all with parentheses.

As I believe Shriram said, the problem is the *perceptions* of people 
who think that parens are bad, not whether parens are actually bad.

For decades, Lisp people have been saying "Try parens!  You'll like 'em 
once you try 'em!" but that argument has not been as persuasive as we 
might've hoped in getting people to try.

Regarding P4P, I have no real opinion on whether offering people a 
parens-free syntax is a good idea, so long as people who wish to use 
parens are not somehow marginalized somewhere along the line.

-- 
http://www.neilvandyke.org/

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev