Re: [racket-dev] for/first and multiple values

2010-08-29 Thread David Van Horn

On 8/29/10 8:33 PM, Carl Eastlund wrote:

On Sun, Aug 29, 2010 at 8:32 PM, David Van Horn  wrote:

On 8/29/10 8:27 PM, Carl Eastlund wrote:


What do you propose for/first should return if the set s is empty?


#f?


Which will do what in a 2-valued context?


Blow up I suppose.  I don't care; I'm not going to use for/first with an 
empty set.


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


Re: [racket-dev] for/first and multiple values

2010-08-29 Thread Carl Eastlund
On Sun, Aug 29, 2010 at 8:32 PM, David Van Horn  wrote:
> On 8/29/10 8:27 PM, Carl Eastlund wrote:
>>
>> What do you propose for/first should return if the set s is empty?
>
> #f?

Which will do what in a 2-valued context?

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


Re: [racket-dev] for/first and multiple values

2010-08-29 Thread David Van Horn

On 8/29/10 8:27 PM, Carl Eastlund wrote:

What do you propose for/first should return if the set s is empty?


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


Re: [racket-dev] for/first and multiple values

2010-08-29 Thread Carl Eastlund
What do you propose for/first should return if the set s is empty?  It
will be somewhat difficult to make it divine that it ought to return
two values.  Perhaps, if this feature is adopted, for/first should
allow a #:default keyword to specify the return value if no elements
crop up, so you can put in the right number of values.

Carl Eastlund

On Sun, Aug 29, 2010 at 8:21 PM, David Van Horn  wrote:
> Why is the body of a for/first a single valued context?  I would expect this
> to work:
>
>  (let ((s (set 1 3 10)))
>    (for/first ((x (in-set s)))
>      (values x (set-remove s x
>
> But I get:
>
>   context expected 1 value, received 2 values: 1 (set 3 10)
>
> (By the way, this operation would be nice to have in racket/set.)
>
> David
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] for/first and multiple values

2010-08-29 Thread David Van Horn
Why is the body of a for/first a single valued context?  I would expect 
this to work:


  (let ((s (set 1 3 10)))
(for/first ((x (in-set s)))
  (values x (set-remove s x

But I get:

   context expected 1 value, received 2 values: 1 (set 3 10)

(By the way, this operation would be nice to have in racket/set.)

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


Re: [racket-dev] printing images in REPL

2010-08-29 Thread Robby Findler
I've added an index entry for 'configure-runtime now. Here's the
relevant page (the last section):

http://docs.racket-lang.org/reference/running-sa.html

Robby

On Sat, Aug 28, 2010 at 9:18 PM, Robby Findler
 wrote:
> And sorry: here's a keyword: read-language. You'll want to set up your
> language so that it can answer those queries. Then drracket will call
> the info proc with 'configure-runtime. I could have sworn that was
> documented somewhere, but I'm not finding it (I think that must be a
> bug in searching or the entry got lost or something). In any case
> drracket usees it like this:
>
>                (let ([configs (get-info 'configure-runtime '())])
>                  (for ([config (in-list configs)])
>                    ((dynamic-require (vector-ref config 0)
>                                      (vector-ref config 1))
>                     (vector-ref config 2
>
> where get-info comes from read-language.
>
> And yes, this is on my list to add to the guide-like docs in the tools manual.
>
> hth,
> Robby
>
> On Sat, Aug 28, 2010 at 8:49 PM, Robby Findler
>  wrote:
>> Did you forget what I explained at PLT day? You don't seem to be
>> asking questions in terms of those things, so I'm not sure whether
>> what I say is getting thru at all.
>>
>> Robby
>>
>> On Sat, Aug 28, 2010 at 8:47 PM, Shriram Krishnamurthi  
>> wrote:
>>> ... which was my original question.  But thanks.
>>>
>>> On Sat, Aug 28, 2010 at 9:36 PM, Robby Findler
>>>  wrote:
 I guess you don't have the print handler set up right.

 On Sat, Aug 28, 2010 at 8:23 PM, Shriram Krishnamurthi  
 wrote:
> The value I was returning is whatever kind of object is returned when
> you embed an image in the Definitions window.  That is, this was a
> pasted, atomic image, not one created by a computation.  I guess
> they're not treated the same, but I'm surprised that ASL processing
> the Definitions window didn't do the right conversion...
>
> On Thu, Aug 26, 2010 at 8:25 PM, Robby Findler
>  wrote:
>> At the moment there is a barn-door sized security hole in DrRacket,
>> whereby it will take any snip% instance from the user's program and
>> just display it in the repl. You can exploit this for Good by making
>> the current-print of your language turn some values into snips (like
>> images and things). 2htdp/image already does this, so that should just
>> work if you return those. Its hard to tell what value Shriram's
>> program was returning tho. But if it is a bitmap% object, he just has
>> to do
>>
>>  (make-object image-snip% ...the-bitmap-goes-here...)
>>
>> We will close this hole at some point, when we have a reasonable way
>> to allow people to add new kinds of values without the security
>> breach.
>>
>> Robby
>>
>> On Thu, Aug 26, 2010 at 6:17 PM, Jay McCarthy  
>> wrote:
>>> From what I can tell, it comes from ensuring that DrRacket shares the
>>> htdp/image (or whatever) namespace with the running program so the
>>> structs are the same and DrRacket's default renderer is detecting it.
>>> I'm not sure how to replicate it though. (I tried for a bit so I could
>>> make #lang frtime work.)
>>>
>>> Jay
>>>
>>> On Thu, Aug 26, 2010 at 11:55 AM, Shriram Krishnamurthi 
>>>  wrote:
 What is the #lang magic that makes

> (get-image-from-web "http://racket-lang.org/logo.png";)
 (instantiate (class ...) ...)

 show the image rather than just its constructor?

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

>>>
>>>
>>>
>>> --
>>> Jay McCarthy 
>>> Assistant Professor / Brigham Young University
>>> http://teammccarthy.org/jay
>>>
>>> "The glory of God is Intelligence" - D&C 93
>>> _
>>>  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] What happened to image=? in 2htdp/image

2010-08-29 Thread Nadeem Abdul Hamid
Oh, I see what happened: image=? is provided from lang/htdp-*, which I
happened to not have not imported -- I was working in a Racket file
that only imported 2htdp/image. And then I looked in the "Equality
testing of images" section of the 2htdp/image documentation:
   
http://docs.racket-lang.org/teachpack/2htdpimage.html#(part._.Equality_.Testing_of_.Images)
and it didn't mention image=?, nor was it anywhere else on the page,
while it does occur in the documentation of htdp/image:
   
http://docs.racket-lang.org/teachpack/image.html#(def._((lib._htdp/image..rkt)._image~3d~3f))

So, yes, maybe image=? should be re-exported from 2htdp/image, or at
least mentioned/linked to in the section about equality of images.

--- nadeem


On Sun, Aug 29, 2010 at 2:58 PM, Robby Findler
 wrote:
> image=? seems to work okay to me.  Is there some misleading
> documentation or something somewhere that gives you the impression
> that image=? doesn't work?
>
> Robby
>
> On Sun, Aug 29, 2010 at 12:58 PM, Nadeem Abdul Hamid  wrote:
>> Is the idea to use equal? to compare images? Wouldn't it be better to
>> define image=? just for the sake of uniformity?
>>
>> --- nadeem
>> _
>>  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] What happened to image=? in 2htdp/image

2010-08-29 Thread Robby Findler
image=? seems to work okay to me.  Is there some misleading
documentation or something somewhere that gives you the impression
that image=? doesn't work?

Robby

On Sun, Aug 29, 2010 at 12:58 PM, Nadeem Abdul Hamid  wrote:
> Is the idea to use equal? to compare images? Wouldn't it be better to
> define image=? just for the sake of uniformity?
>
> --- nadeem
> _
>  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] What happened to image=? in 2htdp/image

2010-08-29 Thread Nadeem Abdul Hamid
Is the idea to use equal? to compare images? Wouldn't it be better to
define image=? just for the sake of uniformity?

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


Re: [racket-dev] more space in GUI?

2010-08-29 Thread Robby Findler
I've pushed a change that puts the check boxes between the radio
boxes. See if you think that looks okay.

Robby

On Fri, Aug 27, 2010 at 12:34 PM, Shriram Krishnamurthi  
wrote:
> The language chooser details panel looks like the attachment.  It
> looks like there are five Output Styles and Fraction Style combined,
> rather than two distinct blocks of 3 and 2.  A little spacing might
> make it a bit easier to read.
>
> _
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev
>
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev