Re: [racket] racket library for minecraft pi edition

2013-06-10 Thread grant centauri
thanks for the reply. I found a short write-up on the API. It shows > > setBlocks(x1, y1, z1, x2, y2, z2, blockType, blockData) - set lots of > blocks all at the same time by providing 2 sets of co-ordinates (x, y, z) > and fill the gap between with a blockType > > If a similar function is avail

Re: [racket] racket library for minecraft pi edition

2013-06-10 Thread Sean Kanaley
I found a short write-up on the API. It shows setBlocks(x1, y1, z1, x2, y2, z2, blockType, blockData) - set lots of blocks all at the same time by providing 2 sets of co-ordinates (x, y, z) and fill the gap between with a blockType If a similar function is available for get blocks, that woul

[racket] racket library for minecraft pi edition

2013-06-10 Thread grant centauri
hello, i've been exploring the educational possibilities of connecting a Lisp language to the Minecraft Pi Edition. I started by writing a tutorial using Common Lisp http://www.lincolnix.net/gcentauri/build-tower.html which uses a basic connection API I wrote. This is really my first attempt at a

Re: [racket] Rosetta Sokoban Solution

2013-06-10 Thread Matthias Felleisen
At the moment, you seem to be using some lib/ collection at Rosetta for your code. (I didn't have time to figure it out.) What I am proposing is that you develop a pico/ collection and that you turn into a language collection. Do it on a case by case. Then you can post two solutions to any pr

Re: [racket] Adding new Rosetta tasks

2013-06-10 Thread Sean Kanaley
What would be the best task to show off Racket's advantages intrinsic to the language and less to library support? It would have to somehow abuse hygienic macros I suppose--some kind of task like embedding a DSL, so what would be a good one? Maybe something with graphics to show off functiona

Re: [racket] Rosetta Sokoban Solution

2013-06-10 Thread Sean Kanaley
It doesn't have to be exactly PicoLisp. I would be happy with a thin wrapper library that simply translates super-long-names into names. Define being called "define" because it equals the English spelling isn't too compelling or else German programmers are in trouble. define is definieren.

[racket] proposal for variant types

2013-06-10 Thread Eric Tanter
Hi, Sorry if this has been discussed before. One of the things I often miss while programming in Racket, is variant types. In Shriram's PLAI, there is a `define-type' form: (define-type Expr [num (n number?)] ...) This is very helpful, with two caveats: 1- it requires contracts

[racket] Adding new Rosetta tasks

2013-06-10 Thread Daniel Prager
Sean wrote: > Also, Racket is one short of Python in popularity. If > someone could do two more we'll defeat those lazy Python > programmers, probably with less work! Also, you can add your new tasks, which opens up another strategy for advancing the Racket ranking. Guidelines on new task creatio

Re: [racket] Test to disambiguate x-expression attributes vs. content?

2013-06-10 Thread Jay McCarthy
I wasn't referencing the docs. I'm just talking abstractly. The point is that you have to consider the attribute list as a totally different kind of thing. The thing you cite can be directly turned into a match pattern, though: (match xe [(? string? s) ] [(list (? symbol? tag) (list (list (?

Re: [racket] Test to disambiguate x-expression attributes vs. content?

2013-06-10 Thread Matthew Butterick
Aha, the xexpr-drop-empty-attributes is probably best, since it will produce consistent forms. Thanks. BTW what part of the docs are you citing for *(list* Symbol (option AttributeList) XexprList)*? The only definition of X-expressions I'm aware of is here

Re: [racket] Test to disambiguate x-expression attributes vs. content?

2013-06-10 Thread Jay McCarthy
The type of Xexpr is... | AtomicContent | (list* Symbol (option AttributeList) XexprList) It sounds like you have one function F that you would like to give the type "Xexpr -> Value", but you are having a problem when you apply it to the AttributeList. You should have such a problem, because an At

Re: [racket] Rosetta Sokoban Solution

2013-06-10 Thread Tim Brown
On 10 Jun 2013 19:03, "Asumu Takikawa" wrote: > I wonder if that's not at least partly due to syntax coloring. I'm still on their case! > Cheers, > Asumu Tim Racket Users list: http://lists.racket-lang.org/users

[racket] Test to disambiguate x-expression attributes vs. content?

2013-06-10 Thread Matthew Butterick
Consider an x-expression that represents an XML tag, so it has the general form '(tag ((attr-name "attr-value") ... ) content ...) The attributes or content might be omitted, of course. When I recursively process these expressions, I start by decomposing the x-expression into components: tag ((

Re: [racket] Rosetta Sokoban Solution

2013-06-10 Thread Matthias Felleisen
On Jun 10, 2013, at 1:49 PM, Sean Kanaley wrote: > But if I had to choose which language seems to actually produce better code, > I would have to side with PicoLisp. I wonder whether we could implement pico as a language and then write #lang racket/pico and just reuse the PicoLisp code.

Re: [racket] Rosetta Sokoban Solution

2013-06-10 Thread Matthias Felleisen
Definitely true. Also: -- I think we should follow the commenting style of neighboring languages -- And I think we should use white space line to separate top-level definitons. On Jun 10, 2013, at 1:58 PM, Asumu Takikawa wrote: > On 2013-06-10 12:42:24 -0400, Matthias Felleisen wrote: >

Re: [racket] Rosetta Sokoban Solution

2013-06-10 Thread Asumu Takikawa
On 2013-06-10 12:42:24 -0400, Matthias Felleisen wrote: > This is not a criticism of your code but I will say that Racket code > looks dense and overbearing compared to PicoLisp, Python, and Tcl. > Hmph. I wonder if that's not at least partly due to syntax coloring. Cheers, Asumu

Re: [racket] Rosetta Sokoban Solution

2013-06-10 Thread Sean Kanaley
Firstly, do you suggest I remove the comments, in which case use more blank lines or not? I don't mind, and only added them mainly in the hopes it would be helpful to readers as the purpose of Rosetta is to educate. But I agree that it also kind of thickens the code. As for Pico being less t

Re: [racket] Rosetta Sokoban Solution

2013-06-10 Thread J. Ian Johnson
It could be less dense if he turned his comments into useless whitespace. Notice the lack of comments in most other submissions. -Ian - Original Message - From: "Matthias Felleisen" To: "Sean Kanaley" Cc: "Racket Users" Sent: Monday, June 10, 2013 12:42:24 PM GMT -05:00 US/Canada Easter

Re: [racket] Rosetta Sokoban Solution

2013-06-10 Thread Matthias Felleisen
Thank you for this effort. This is not a criticism of your code but I will say that Racket code looks dense and overbearing compared to PicoLisp, Python, and Tcl. Hmph. On Jun 10, 2013, at 12:34 PM, Sean Kanaley wrote: > The rather empty page on Sokoban now has a Racket solution. The cre

[racket] Rosetta Sokoban Solution

2013-06-10 Thread Sean Kanaley
The rather empty page on Sokoban now has a Racket solution. The creator is proud to announce it's the fastest solution (though a couple didn't give run times) at ~0.1 seconds. My thanks to Ryan Culpepper for making the binary heap that made this possible. http://rosettacode.org/wiki/Sokoban#

[racket] (floor (/ ....))

2013-06-10 Thread Bradley Lucier
Re: FWIW, I would have at least written: ((qty (in-range 0 (add1 (min (floor (/ weight-left weight)) (floor (/ volume-left volume))) I have now seen the (floor (/ a b)) idiom a number of times, and wonder why people prefer it to (quotient a b

Re: [racket] Size matters

2013-06-10 Thread Laurent
On Mon, Jun 10, 2013 at 3:46 PM, Sam Tobin-Hochstadt wrote: > On Mon, Jun 10, 2013 at 9:09 AM, Matthias Felleisen > wrote: > > > > On Jun 10, 2013, at 8:51 AM, Laurent wrote: > > > > On Sun, Jun 9, 2013 at 7:54 PM, Matthias Felleisen > > > wrote: > >> > >> (struct-open item item1 weight val

Re: [racket] Size matters

2013-06-10 Thread Tim Brown
On 10/06/13 14:08, Matthias Felleisen wrote: Thanks for the reply. On Jun 10, 2013, at 8:20 AM, Tim Brown wrote: Am I missing a trick? Why not struct-copy: Why not? Because I couldn't see it in the documentation for looking! Seriously, it's really useful having that pointed out. Thanks ag

Re: [racket] Size matters

2013-06-10 Thread Sam Tobin-Hochstadt
On Mon, Jun 10, 2013 at 9:09 AM, Matthias Felleisen wrote: > > On Jun 10, 2013, at 8:51 AM, Laurent wrote: > > On Sun, Jun 9, 2013 at 7:54 PM, Matthias Felleisen > wrote: >> >> (struct-open item item1 weight value volume) > > > I would love to see such an addition to core Racket! > > It's on

Re: [racket] Size matters

2013-06-10 Thread Matthias Felleisen
On Jun 10, 2013, at 8:18 AM, Tim Brown wrote: > On 09/06/13 18:54, Matthias Felleisen wrote: >> I have taken the liberty to rewrite the code according to the Style >> gide, since I am the author of this document: > > I've found this (and I have seen it before): > http://www.ccs.neu.edu/home/matt

Re: [racket] Size matters

2013-06-10 Thread Matthias Felleisen
On Jun 10, 2013, at 8:51 AM, Laurent wrote: > On Sun, Jun 9, 2013 at 7:54 PM, Matthias Felleisen > wrote: > (struct-open item item1 weight value volume) > > I would love to see such an addition to core Racket! It's on my todo-list. Racket Users list: http://list

Re: [racket] Size matters

2013-06-10 Thread Laurent
FWIW, I would have at least written: ((qty (in-range 0 (add1 (min (floor (/ weight-left weight)) (floor (/ volume-left volume))) Looks much more readable to me. I would probably have taken the `(add1 )' or the `(min )' (depending which one ma

Re: [racket] Size matters

2013-06-10 Thread Tim Brown
On 09/06/13 18:54, Matthias Felleisen wrote: (define item (first items)) (define weight (item-weight item)) (define volume (item-volume item)) (define value (item-value item)) Now I understand that the three lines of extracting the content of the first struct are painfu

Re: [racket] scribble syntax suggestion wrt text-mode and racket-mode arguments

2013-06-10 Thread Robby Findler
Would something like this work for your use? '@f{3 4 @5 @6} = '(f "3" "\n" "4 " 5 " " 6) (Eli may know a way to get around the extra spaces that get inserted.) Robby On Sun, Jun 9, 2013 at 11:15 PM, Matthew Butterick wrote: > Perhaps I'm overlooking some obvious complication. But today

Re: [racket] Size matters

2013-06-10 Thread Tim Brown
Eli, Matthias, thanks to both of you for your comments on this code (for whose creation I am responsible / to blame). I hope I'm not too out of order addressing your responses together in this one email. I thought I was doing pretty well when I changed the original "style" to struct item from a w

[racket] Question on racket/gui and font

2013-06-10 Thread Mag. Dr. Nikolaus Klepp
Hi! I'm having some issue with fonts when creating GUI elements. In my understanding, when I pass [font some-font] when creating a new object, then that object should take that font to render its controls. This works on button%, but not on other elemts like group-box-panel% or tab-panel%. So,