Michael Sperber | 17 Apr 09:22 2014
Picon

2nd CFP: FARM 2014: Functional Art, Music, Modelling and Design


If you are using Racket or any mostly functional language in any
kind of musical, artistic, or design endeavour, please consider
contributing to FARM 2014, the 2nd ACM SIGPLAN International Workshop
of Functional Art, Music, Modelling and Design, co-located with ICFP
2014.

Find attached the Call for Papers and Demo Proposals.

Regards,
Mike

--------------------------------------------------------------

			 FARM 2014

	 2nd ACM SIGPLAN International Workshop on
	Functional Art, Music, Modelling and Design

	   Gothenburg, Sweden; 6 September, 2014

                http://functional-art.org

The ACM SIGPLAN International Workshop on Functional Art, Music,
Modelling and Design (FARM) gathers together people who are harnessing
functional techniques in the pursuit of creativity and expression.

Functional Programming has emerged as a mainstream software
development paradigm, and its artistic and creative use is booming. A
growing number of software toolkits, frameworks and environments for
(Continue reading)

Alexander D. Knauth | 17 Apr 04:33 2014

Sometimes (syntax-e #<syntax (lambda (x) #f)>) produces a non-list pair

Basically, I have a macro, called proc-with-stx, that captures an expression and stores it in a syntax
object, and I have another macro, called lambda-with-stx, that expands to (proc-with-stx (lambda
…)).  
When I use (proc-with-stx (lambda (x) #f), then the syntax-e of the syntax-object is a list, but when I use
(lambda-with-stx (x) #f), which should expand to the same thing, the syntax-e of the syntax-object is a
non-list pair:

#lang racket

(module+ test
  (require rackunit))

(struct proc+stx (proc stx)
  #:property prop:procedure (struct-field-index proc))

(define-syntax-rule (proc-with-stx expr)
  (proc+stx expr #'expr))

(define-syntax-rule (lambda-with-stx args body ...)
  (proc-with-stx (lambda args body ...)))

(module+ test
  (define f
    (lambda-with-stx (x) #f))
  (define f2                               ; f should expand to f2
    (proc-with-stx (lambda (x) #f)))

  (define f-stx  (proc+stx-stx f))
  (define f2-stx (proc+stx-stx f2))

(Continue reading)

Mikko Tiihonen | 16 Apr 23:01 2014
Picon

Re: Testing "impossible" branches in the code

Forwarding a copy to the list...

> Lähettäjä: Mikko Tiihonen <mikko.tiihonen@...>
> Aihe: Re: [racket] Testing "impossible" branches in the code
> Päivämäärä: 16. huhtikuuta 2014 21.07.39 UTC+3
> Vastaanottaja: Matthias Felleisen <matthias@...>
> 
> That's right :) Racket's contract system will probably be very suitable for my purposes. I plan to map the
dependencies between the functions and arrange independent functions into submodules so that I can
write contracts for them. I presume that the code will also be prettier after that...
> 
> Cheers,
> 
> -Mikko
> 
> Matthias Felleisen <matthias@...> kirjoitti 15.4.2014
kello 23.49:
> 
>> 
>> On Apr 15, 2014, at 4:02 PM, Mikko Tiihonen
<mikko.tiihonen@...> wrote:
>> 
>>> as I dissected the code it became clear to me that my implementation had been far from clean. One of the
problems was that the responsibility for checking return values was not in the function returning the
value, but in the calling function.
>>> 
>>> The main thing seems to be that I need to check return values for type and also for range. After some
refactorings I have transferred the responsibility for checking these values so that testing became
easier. Also, It starts to look like typed Racket would be an appropriate solution for making the code more robust.
>> 
(Continue reading)

jab | 16 Apr 22:45 2014

canonical index of Racket courses? [was: Summer programs learning Racket for a student]

I recently asked here about in-person Racket courses available this summer which I could recommend to a student I've been tutoring. (Thanks again to everyone who let me know about their courses so far.)

To make this info easier to find, I'm wondering if the racket-lang.org maintainers would be interested in publishing a canonical index of Racket courses (both online and in-person) linked off the "Community" or "Learning" sections on the homepage, and inviting the community to add to it.

(Similarly, linking to a canonical index of Racket meetup groups (à la http://clojure.meetup.com/ and https://wiki.python.org/moin/LocalUserGroups)  would be great too. Google turned up http://racket.meetup.com/ but 2 of the 3 results there are for racket sports.)

Thanks, and looking forward to knowing how to become better plugged into the Racket community!
____________________
  Racket Users list:
  http://lists.racket-lang.org/users
Yi D | 16 Apr 21:14 2014
Picon

About the always-renaming strategy in hygienic macro expansion

Hi,

I am trying to understand hygienic macro expansion by looking into 
the algorithms, in the paper "Macros That Work" and "Syntactic 
Abstraction in Scheme".  Any of them may not exactly be what is 
implemented in Racket but presumably the essential ideas are not 
that different. Currently I encounter two problems in understanding:

1. If I understand these algorithms correctly, the lexical environment 
of a macro definition is saved into a syntactic closure, so that free 
variables inserted into the body of a macro will not be captured by any 
binding construct in the context of a macro call. But I notice that 
both expansion algorithms always rename bound variables of some core 
binding constructs, like lambda. I see that if such a core binding 
construct is inserted into the body of a macro, its bound variables 
should be renamed to avoid capturing free variables from the context of 
the macro call. But if such a core binding construct does not occur in 
the body of a macro, its bound variables do not need be renamed. So I 
wonder whether this always renaming strategy is simply a disregard of 
distinguishing these two cases. If so, why do these algorithms do not 
do the case distinction? Because it is too difficult or because it 
would further complicate the algorithms?

2. Both algorithms also always rename pattern variables. I was told 
that this is because a macro can insert another macro definition into 
its body. Thus similar to the case of inserting a core binding construct, 
the pattern variables should also be renamed. Although I can imagine 
this, I think I would appreciate a good example that illustrates this
kind of capture.

Thank you for your attention.

Cheers,

Yi
____________________
  Racket Users list:
  http://lists.racket-lang.org/users
Laurent | 16 Apr 11:10 2014
Picon

matrix-solve and approximation errors

I've just been bitten by a bad case of floating-point error with `matrix-solve` (and a bad CPU that has some floating-point issues):

(let ([n 0.8200000000000001 #;(+ (* .9 .9)(* .1 .1))])
  (matrix-solve
   (matrix [[ 1  0 .9 1]
            [ 0  1 .1 1]
            [.9 .1  n 1]
            [ 1  1  1 0]])
   (col-matrix [0 0 0 1])))
; -> (array #[#[0.0] #[0.5] #[0.0] #[-0.5]])

But clearly here M×X≠B, as is easily seen on the last row.
I've seen other situations where the approximation leads to an approximate solution (which is okay of course), but this is the first case I see where the result is completely off.

I have no idea if anything can be done about it, though (apart from throwing my computer through the window and buy a better one).

Laurent
____________________
  Racket Users list:
  http://lists.racket-lang.org/users
Faré | 15 Apr 21:27 2014
Picon

untrusted

This is the perfect game to learn a language (in this case, javascript):
http://alexnisnevich.github.io/untrusted/

Has anyone written a racket version, already?

—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
I’d like to confess, Papa, at that moment I discovered
that I really like killing. — Ernesto "Che" Guevara

____________________
  Racket Users list:
  http://lists.racket-lang.org/users
Manfred Lotz | 15 Apr 21:09 2014
Picon

Regexp question

On Rosetta code in "Count occurrences of a substring" I found this for
Racket:

(define count-substring 
  (compose length regexp-match*))

Example:
(count-substring "th" "the three truths")
3

I like to use it for getting the number of occurences of a
list of characters in a string.

For this I used it like this:

  (count-subsring "[a-z2;]" "arst;452")

Let us assume the part between the brackets could be anything. How
would I escape certain characters in order to make sure the regular
expression still works fine?

Examples:

-> (count-substring "[\\[]" "a[rts[a3]")
2
-> (count-substring "[a-z\\[]" "a[rts[a3]")
7
-> (count-substring "[\\]]" "a[rts[a3]")
0

The first two seem to work fine, the last one doesn't.

--

-- 
Manfred

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

jab | 15 Apr 17:07 2014

Summer programs learning Racket for a student

Dear Racket Users,

I've been tutoring an 8th grader in Racket for the last few months. We're just about to finish part I of HtDP2e (http://www.ccs.neu.edu/home/matthias/HtDP2e/part_one.html).

He's interested in doing a summer program along the lines of http://www.idtech.com/teens/ but ideally he'd be able to continue learning Racket where we leave off. Does anyone know of any summer programs for teens where Racket is the language used?

A friend of mine used to teach one at Brown, but from http://www.brown.edu/ce/pre-college/catalog/?p%5B%5D=1 it looks like now only bash, Python, and Matlab are available. Google searches like "racket programming summer camp" didn't immediately turn up anything either (and inevitably include results about tennis camps).

Thanks for any tips you may have.
____________________
  Racket Users list:
  http://lists.racket-lang.org/users
jvjulien | 15 Apr 10:39 2014
Picon

packages

Good morning,

I installed planet-jeeve-dynablaster1 via the package manager, but the instruction (require
planet-jeeve-dynablaster1) doesn't work

Thanks for your help

jeeve
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Eduardo Costa | 15 Apr 00:52 2014
Picon

Menezes' Book.

I paid a visit to Vitruvius Architecture & Design, where people were doing some impressive work in building film scenery and set. Unhappily the architects refused to tell me how to perform the magic. However, I was able to collect information that may help in reverse engineering their job.

As far as I know, they use a book called Programming for Architecture, of  Antonio Menezes Leitao, a well known Lisp programmer. The programs have the following headers:

#lang racket
(require rosetta)
(backend rhino)

As soon as I arrived to my office, I installed Racket 6.0 in my Macintosh, and added the above headers. I got the following message:

standard-module-name-resolver: collection not found
  for module path: rosetta
  collection: "rosetta"
  in collection directories:
   /home/rosa/.racket/6.0/collects
   /home/rosa/racket/collects

I guess there is a rosetta collection that I must obtain it from

http://planet.racket-lang.org/display.ss?package=rosetta.plt&owner=aml

 However I have a few questions. Can I run rosetta-lang on a OS-X (MacIntosh)? On Linux? In planet.racket-lang.org, the authors say that rosetta requires Rhino or Autocad, that are Windows applications. However, I have seen people running rosetta on OS-X. Besides this, the authors say:

"At the moment, we only support Rosetta for Windows. If you want to use Rosetta in Mac or Linux please contact us."

Whom should I contact? I don't need anything very fancy. I just want to write scenery for educational games. Therefore a backend much simpler than Rhino or Autocad will do.







____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Gmane