Shriram Krishnamurthi | 1 Jul 2010 02:12
Favicon
Gravatar

Re: [racket] two languages at a time in DrRacket

"easy" is great.  I assume I should ignore the comment that says

  ; XXX This is almost certainly wrong.

Shriram
Jay McCarthy | 1 Jul 2010 02:50
Picon
Gravatar

Re: [racket] two languages at a time in DrRacket

Ya :) It works but I don't think it is the right way to do it.

Jay

On Wed, Jun 30, 2010 at 6:12 PM, Shriram Krishnamurthi <sk <at> cs.brown.edu> wrote:
> "easy" is great.  I assume I should ignore the comment that says
>
>  ; XXX This is almost certainly wrong.
>
> Shriram
>

--

-- 
Jay McCarthy <jay <at> cs.byu.edu>
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/users
synx | 1 Jul 2010 08:04
Picon

Re: [racket] Anyone using Dorodango? Any other movement towards an R6RS package system?


On 06/30/2010 03:04 AM, Noel Welsh wrote:
> I really
> think the Scheme world would be much much much better served by these
> developers contributing their efforts to a single implementation.

In particular, one nice thing about Racket is that it provides not so
much a language implementation, but an inter-language implementation
interface. So you could (in theory) write a Racket module that turned
itself into native binary assembler, but then use it together with
another module that was JIT compiled bytecode. You could even (in
theory) write a language in Racket that produced an intermediate C
representation that was then compiled with a C compiler into a program.
So all those programs like Chicken, Ypsilon, Larceny and such, the same
effort put into those projects would have produced an equally effective
Racket language capable of doing the same damn thing, while also being
100% compatible with anything written in "#lang racket".

People will always disagree on exactly what's important to have in a
scheme implementation, but I like to think that we could work together
enough to at least be able to load each other's modules. And once that
has been accomplished, I don't see why we couldn't call the system to do
so "Racket" because that's exactly what Racket is.
Noel Welsh | 1 Jul 2010 10:25
Picon

Re: [racket] Anyone using Dorodango? Any other movement towards an R6RS package system?

This is a very elegant argument.

It has just occurred to me that, AFAIK, a .plt file is just a
mime-encoded gzipped tar. To use Planet as a distribution mechanism
for R6RS modules should therefore be straightforward (on Unix
systems). The only thing needed beyond creating the tarball is an
info.rkt file.

N.

On Thu, Jul 1, 2010 at 7:04 AM, synx <plt@...> wrote:
> In particular, one nice thing about Racket is that it provides not so
> much a language implementation, but an inter-language implementation
> interface. ...
Shriram Krishnamurthi | 1 Jul 2010 14:19
Favicon
Gravatar

Re: [racket] Anyone using Dorodango? Any other movement towards an R6RS package system?

> The only thing needed beyond creating the tarball is an
> info.rkt file.

You underestimate the Scheme "community"'s ability to divide.  The
controversy will shift entirely to what is acceptable in info.rkt
files.  Soon you will end up with the Revised^n Reports on the Racket
Information File Format, which will be accused of all sorts of
unSchemely practices like being too static, allowing square brackets,
etc.

Shriram
Robby Findler | 1 Jul 2010 14:47
Gravatar

Re: [racket] Anyone using Dorodango? Any other movement towards an R6RS package system?

Okay guys. Time to move this one to cls. Scheme is a noble endeavor
and if you want to poke it with a stick, do it elsewhere.

Robby

On Thursday, July 1, 2010, Shriram Krishnamurthi <sk <at> cs.brown.edu> wrote:
>> The only thing needed beyond creating the tarball is an
>> info.rkt file.
>
> You underestimate the Scheme "community"'s ability to divide.  The
> controversy will shift entirely to what is acceptable in info.rkt
> files.  Soon you will end up with the Revised^n Reports on the Racket
> Information File Format, which will be accused of all sorts of
> unSchemely practices like being too static, allowing square brackets,
> etc.
>
> Shriram
> _________________________________________________
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/users
>
_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users
Brad Long | 1 Jul 2010 16:35

[racket] Redefining selectors - another newbie question

Thankyou racket gurus for your advice. My program using a "loop" now works:
(for-each (fn(x)(display x)(newline)) (.. 10 1)) (display "blastoff!")
--
I have another question, is it possible (preferably easy) to use dot 
notation for the auto-generated selectors (e.g. for (point x y z), instead 
of point-x can we use point.x)? I am not exactly sure how to redefine that 
since it is auto-created on construction of the struct.

I have just donned my flame-proof clothing.

Thanks.

Stephen De Gabrielle | 1 Jul 2010 16:42
Picon

Re: [racket] affing a panel to DrRacket

it's lives, but I'm still  a little confused on how I set where it sits in the layout, and how to make it dragable - the class is not enough.  I appreciate the help - I'm having a bad run at making sense of the documentation.

the relevant bit;
[...]
    (define (tabs-mixin super%)
      (class super%
        (define text (new text%))
        (super-new)
        (let* ((area-container (send this get-area-container))
               (test-panel (new panel:horizontal-dragable% (parent area-container)))
               (text (new text%))
               (ed (new editor-canvas% (parent test-panel))))
          (send ed set-editor text)
          #;(send area-container add-child test-panel))  ;;; I need a parent to instantiate a panel.
        )) 
[...]

As you can see I'm also curious about the nature of the add-child method, given that the panel is added at instantiation, and a parent is required.

Thanks again for your help.
,
Stephen

Full file;

#lang racket/base
(require mred
         racket/class
         scheme/file
         scheme/contract
         framework/framework
         framework
         racket/unit
         drracket/tool-lib
         drscheme/tool
         )

(provide tool <at> )

(define tool <at>
  (unit
    (import drracket:tool^)
    (export drracket:tool-exports^)
    (define (phase1) (void))
    (define (phase2) (void))
   
(define (tabs-mixin super%)
      (class super%
        ; frame:basic<%>
        ; frame:basic-mixin: do not add children directly to a frame:basic (unless using make-root-area-container)
        ; use the get-area-contaner method instead
        (define text (new text%))
       
        (inherit get-current-tab get-menu-bar get-button-panel register-toolbar-button)
        (super-new)
       
        (let* ((area-container (send this get-area-container))
               (test-panel (new panel:horizontal-dragable% (parent area-container)))
               (text (new text%))
               (ed (new editor-canvas% (parent test-panel))))
          (send ed set-editor text)
          #;(send area-container add-child test-panel))
        ))
   
   
    (drracket:get/extend:extend-unit-frame tabs-mixin)
    ))

;; info file
#lang setup/infotab

(define name "Cosmonaut")
(define version "0.1")
(define release-notes '("for Racket 5"))
(define blurb '("Cosmonaut lets you explore the PLaneT package repository from within DrScheme."))

(define doc.txt "doc.txt")
(define homepage "http://sp.degabrielle.name/cosmonaut")


(define drracket-tools '(("cosmonaut.rkt")
                         ;("fossil.rkt")
                         ;("tabs.rkt")
                         ))

(define drracket-tool-names '("Cosmonaut"
                              ;"Fossil"
                              ;"Tabs"
                              ))

;(define drracket-tool-icons (list (list "cosmonaut.png" "fossil.png" "projectmgr.png")))
(define drracket-tool-urls  '(("http://sp.degabrielle.name/cosmonaut")
                              ;("http://sp.degabrielle.name/Fossil")
                              ;("http://sp.degabrielle.name/Tabs")
                              ))









On Wed, Jun 30, 2010 at 5:02 PM, Robby Findler <robby <at> eecs.northwestern.edu> wrote:

You want to create a tool, add in a frame-mixin (both via the tools
interface), and then use the frame:basic<%> mechanism for adding
panels to the frame.

If that's not enough to get you started, I'll write up a little
example tool that does it.

Robby

On Wed, Jun 30, 2010 at 8:30 AM, Stephen De Gabrielle
<spdegabrielle <at> gmail.com> wrote:
> Hi,
>
> Please forgive my ignorance,  I'm trying to work out how to add a panel
> (like program contour) to DrRacket.
>
> Does anyone know the correct method, or can point me to source code, or the
> right bit of the documentation?
>
> Cheers,
>
> Stephen
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>



--

--
Stephen De Gabrielle
stephen.degabrielle <at> acm.org
Telephone +44 (0)20 85670911
Mobile        +44 (0)79 85189045
http://www.degabrielle.name/stephen

<div>
<p>it's lives, but I'm still&nbsp; a little confused on how I set where it sits in the layout, and how to make it dragable - the class is not enough.&nbsp; I appreciate the help - I'm having a bad run at making sense of the documentation.<br><br>the relevant bit; <br>[...]<br>&nbsp;&nbsp;&nbsp; (define (tabs-mixin super%)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (class super%<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (define text (new text%))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (super-new)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (let* ((area-container (send this get-area-container))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (test-panel (new panel:horizontal-dragable% (parent area-container)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (text (new text%))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ed (new editor-canvas% (parent test-panel))))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (send ed set-editor text)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #;(send area-container add-child test-panel))&nbsp; ;;; I need a parent to instantiate a panel.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ))&nbsp; <br>[...]<br><br>As you can see I'm also curious about the nature of the add-child method, given that the panel is added at instantiation, and a parent is required.<br><br>Thanks again for your help.<br>, <br>
Stephen<br><br>Full file; <br><br>#lang racket/base<br>(require mred<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; racket/class<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scheme/file<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scheme/contract<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; framework/framework<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; framework<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; racket/unit<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; drracket/tool-lib<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; drscheme/tool<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br><br>(provide tool <at> )<br><br>(define tool <at> <br>&nbsp; (unit<br>&nbsp;&nbsp;&nbsp; (import drracket:tool^)<br>&nbsp;&nbsp;&nbsp; (export drracket:tool-exports^)<br>&nbsp;&nbsp;&nbsp; (define (phase1) (void))<br>
&nbsp;&nbsp;&nbsp; (define (phase2) (void))<br>&nbsp;&nbsp;&nbsp; <br>(define (tabs-mixin super%)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (class super%<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; frame:basic&lt;%&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; frame:basic-mixin: do not add children directly to a frame:basic (unless using make-root-area-container)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; use the get-area-contaner method instead<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (define text (new text%))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (inherit get-current-tab get-menu-bar get-button-panel register-toolbar-button)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (super-new)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (let* ((area-container (send this get-area-container))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (test-panel (new panel:horizontal-dragable% (parent area-container)))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (text (new text%))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ed (new editor-canvas% (parent test-panel))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (send ed set-editor text)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #;(send area-container add-child test-panel))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ))<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; (drracket:get/extend:extend-unit-frame tabs-mixin)<br>&nbsp;&nbsp;&nbsp; ))<br><br>;; info file<br>#lang setup/infotab<br><br>(define name "Cosmonaut")<br>(define version "0.1")<br>(define release-notes '("for Racket 5"))<br>(define blurb '("Cosmonaut lets you explore the PLaneT package repository from within DrScheme."))<br><br>(define doc.txt "doc.txt")<br>(define homepage "<a href="http://sp.degabrielle.name/cosmonaut">http://sp.degabrielle.name/cosmonaut</a>")<br><br><br>(define drracket-tools '(("cosmonaut.rkt") <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;("fossil.rkt") <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;("tabs.rkt")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ))<br><br>(define drracket-tool-names '("Cosmonaut"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;"Fossil"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;"Tabs"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ))<br><br>;(define drracket-tool-icons (list (list "cosmonaut.png" "fossil.png" "projectmgr.png")))<br>(define drracket-tool-urls&nbsp; '(("<a href="http://sp.degabrielle.name/cosmonaut">http://sp.degabrielle.name/cosmonaut</a>")<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;("<a href="http://sp.degabrielle.name/Fossil">http://sp.degabrielle.name/Fossil</a>")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;("<a href="http://sp.degabrielle.name/Tabs">http://sp.degabrielle.name/Tabs</a>")<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ))<br><br><br><br><br><br><br><br><br><br>On Wed, Jun 30, 2010 at 5:02 PM, Robby Findler <span dir="ltr">&lt;<a href="mailto:robby <at> eecs.northwestern.edu">robby <at> eecs.northwestern.edu</a>&gt;</span> wrote:<br></p>
<div class="gmail_quote"><blockquote class="gmail_quote">You want to create a tool, add in a frame-mixin (both via the tools<br>

interface), and then use the frame:basic&lt;%&gt; mechanism for adding<br>
panels to the frame.<br><br>
If that's not enough to get you started, I'll write up a little<br>
example tool that does it.<br><br>
Robby<br><div>
<div></div>
<div class="h5">
<br>
On Wed, Jun 30, 2010 at 8:30 AM, Stephen De Gabrielle<br>
&lt;<a href="mailto:spdegabrielle <at> gmail.com">spdegabrielle <at> gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; Please forgive my ignorance,&nbsp; I'm trying to work out how to add a panel<br>
&gt; (like program contour) to DrRacket.<br>
&gt;<br>
&gt; Does anyone know the correct method, or can point me to source code, or the<br>
&gt; right bit of the documentation?<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; Stephen<br>
&gt;<br>
</div>
</div>&gt; _________________________________________________<br>
&gt; &nbsp;For list-related administrative tasks:<br>
&gt; &nbsp;<a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br>
&gt;<br>
</blockquote></div>
<br><br clear="all"><br>-- <br><br>--<br>Stephen De Gabrielle<br><a href="mailto:stephen.degabrielle <at> acm.org">stephen.degabrielle <at> acm.org</a><br>Telephone +44 (0)20 85670911<br>Mobile &nbsp; &nbsp; &nbsp; &nbsp;+44 (0)79 85189045<br><a href="http://www.degabrielle.name/stephen">http://www.degabrielle.name/stephen</a><br><br>
</div>
Matthias Felleisen | 1 Jul 2010 16:49
Favicon

Re: [racket] Redefining selectors - another newbie question


(define posn.x posn-x) 

But that's not quite what you want :-)

On Jul 1, 2010, at 10:35 AM, Brad Long wrote:

> Thankyou racket gurus for your advice. My program using a "loop" now works:
> (for-each (fn(x)(display x)(newline)) (.. 10 1)) (display "blastoff!")
> --
> I have another question, is it possible (preferably easy) to use dot notation for the auto-generated
selectors (e.g. for (point x y z), instead of point-x can we use point.x)? I am not exactly sure how to
redefine that since it is auto-created on construction of the struct.
> 
> I have just donned my flame-proof clothing.
> 
> Thanks.
> 
> _________________________________________________
> For list-related administrative tasks:
> http://lists.racket-lang.org/listinfo/users

Noel Welsh | 1 Jul 2010 16:51
Picon

Re: [racket] Redefining selectors - another newbie question

This is fairly easy, but do you really want to avoid typing '-'?  I
think what you want is this:

Given:

(struct point (x y))

(define pt (point 1 2))

Currently, you write:

(point-x pt)

You want to write:

(pt.x)

Amirite?

N.

On Thu, Jul 1, 2010 at 3:35 PM, Brad Long <brad@...> wrote:
> Thankyou racket gurus for your advice. My program using a "loop" now works:
> (for-each (fn(x)(display x)(newline)) (.. 10 1)) (display "blastoff!")
> --
> I have another question, is it possible (preferably easy) to use dot
> notation for the auto-generated selectors (e.g. for (point x y z), instead
> of point-x can we use point.x)? I am not exactly sure how to redefine that
> since it is auto-created on construction of the struct.
>
> I have just donned my flame-proof clothing.
>
> Thanks.

Gmane