There is a precedent for hosting other languages on top of Racket by compiling their syntax down to Racket. What got me thinking other languages on Racket was Shriram’s P4P article, and also to some degree a discussion surrounding Gambit’s SIX. It got me wondering…
Would PLT have anything to gain from providing a non-parenthesized language created specifically for Racket? What I mean is take Racket, remove the stuff too hard to do without parens, and offer that up as an “official” Racket language. This is not the same as implementing Java on Racket.
How difficult would it be to “come up with” such a language? I’m totally ignorant regarding language design. Would it be interesting… or boring and a waste of time?
Tag: Scheme
A Proposal Against Parentheses in Racket
P4P:
This document proposes an alternate syntax for Racket. It reduces the parenthetical burden, makes the language appear more traditional, and respects indentation, though not in the way you think. It does all this while retaining the essence of Racket syntax, and even offering a high degree of tool reuse.
(via Racket-users)
Updated DrSync to Racket
Just posted the updated version of DrSync for Racket on PlaneT.
Okasaki's Purely Functional Data Structures in Typed Racket
A library of purely functional data structures in Typed Racket. Data structures in the library are based on Chris Okasaki’s book Purely Functional Data Structures, work by Phil Bagwell and others
(via racket)
Lisp, erlang, forth, scheme, prolog, ML maintainer(s) needed urgently in Fedora
See here.
R6RS macros with positional and optional arguments
[Makers] is a distribution of libraries for R6RS Scheme implementations. In the paper:
“Keyword and Optional Arguments in PLT Scheme“. Matthew Flatt and Eli Barzilay. 2009 Workshop on Scheme and Functional Programming.
the authors discuss ways to provide functions and macros with a mix of fixed and optional arguments to better organise abstractions. This package humbly proposes an alternative for R6RS implementations, without the use of “keywords” as disjoint type of values.
(via comp.lang.scheme)
Setting the background color in Slideshow
The OP asked how to set the background color in Slideshow as it is not obvious.
Matthew replied:
Locally, I’d superimpose a picture onto a color rectangle:
#lang slideshow
(define (add-bg p color)
(refocus (cc-superimpose
(colorize
(filled-rectangle (pict-width p)
(pict-height p))
color)
p)
p))
(add-bg (bt "Hello") "green")
To globally set the background, I’d use that in an assembler:
#lang slideshow
(define (add-bg p color)
(refocus (cc-superimpose
(colorize
(filled-rectangle (pict-width p)
(pict-height p))
color)
p)
p))
(current-slide-assembler
(let ([orig (current-slide-assembler)])
(lambda (title sep body)
(ct-superimpose
(inset (add-bg (inset full-page margin) "green")
(- margin))
(orig title sep body)))))
(slide #:title "Example" (bt "Hello"))
(via plt)
How to evaluate expressions and produce no output in Scribble
The OP asked:
Is there a way to evaluate something in a given evaluator without having anything displayed in the output?
Ie. I want to feed a couple of basic function definitions into the evaluator instance that I obtain with (make-base-eval).
Matthew shared the solution: interaction-eval.
(via plt)
Incremental definition and evaluation of examples in Scribble
The scribble/eval library provides utilities for evaluating code at document-build time and incorporating the results in the document, especially to show example uses of defined procedures and syntax.
Here is an example where the OP was:
trying to figure out a way to insert some text in between Scheme definitions: that is, have some definitions (@schemeblock or equivalent), with their explanations (text mode), and then an interaction, like @interaction, except that it should be aware of the preceeding definitions.
Here is the solution:
#lang scribble/manual
@(require scribble/eval)
@(define ex-eval (make-base-eval))
First, we define @scheme[x]:
@interaction[
#:eval ex-eval
(define x 1)
]
Next, we use it:
@interaction[
#:eval ex-eval
x
]
@(close-eval ex-eval)
(via plt)
Highlighting code in Scribble
You can use ‘code:hilite’ to highlight expressions in Scribble generated documentation like this:
@schemeblock[
(+ 1 (code:hilite +inf.0))
]
It doesn’t work for multi-line expressions yet, however.
(via plt)