“Racket” Tagged Pages

Mixing Hand-Written, Generating, and Generated Code with Koog

Revised on
Created on

Some days ago I released a little code generation utility that I have been using for well over a year in cranking out repetitive C++ code. Koog is—for lack of a better established term—a mixed-code generator. It is similar to other tools of its kind (such as Cog), but the only one that I know of that uses the Scheme language for specifying what code to generate. The concept of mixed-code generation is simple.

Read more…

Koog

Revised on
Created on

Koog is a mixed-code generation tool. It supports a choice of comment styles (C-style block comments by default), and assumes that code-generation directives are written in Racket. Koog provides a Racket API, a command-line interface, and editor integration for Emacs and Vim. The one novel feature it has (compared to existing mixed-code generators) is the option of only (re)generating individual code regions, which provides more control when used interactively in an editor.

Read more…

On Racket Support in Emacs Org-Mode

Revised on
Created on

Earlier I blogged about Epresent, which is basically a piece of code for making Org-Mode suitable for preparing presentation slides. There are times when I can’t resist mentioning the innovative Racket programming language in a presentation. In those situations I tend to want to have syntax-highlighted Scheme code on my slides, and also to evaluate the code snippets and insert the results next to the code listing. This is apparently the sort of thing one can do with Org-Mode Babel, for a variety of languages.

Read more…

Opening Racket Modules in Emacs

Revised on
Created on

In recent past, I've adopted Greg Hendershott's racket-mode for Emacs, added keyword completion, hover help, documentation lookup, customized syntax highlighting and indentation and such for my personal tastes, but one thing I haven't really looked at so far is code navigation support for Racket. What seemed like an easy place to start was implementing a function for loading a Racket source file by its module path, as would appear within a require form.

Read more…

Times Are Hard for Racketeers, too

Revised on
Created on

APIs dealing with dates and times must be hard to get right. I'm not aware of any programming language whose standard library for dealing with times is both intuitive and comprehensive. Racket has built-in libraries that are second to none, but even it presently leaves something to be desired when it comes to support for handling dates and times. For example, Racket's racket/date module (in its current incarnation) includes a date->string function, but no string->date function.

Read more…

Dictionary-Enabled Racket Support for Emacs

Written on

For the last month or so I've found Racket programming even more enjoyable than before. The reason for this is a tool named Ractionary (short for Racket Dictionary Generator), which I wrote for extracting information about Racket language names. Said information can easily be used for setting up some Racket language awareness for Emacs. There is an Emacs tradition of running an external Lisp (or "inferior Lisp") process to allow for dynamic evaluation of foreign (non Emacs Lisp) code, and this kind of a solution could be used to query information known to Racket on demand.

Read more…

Another PIM Data Exporter

Written on

My little SMS Exporter utility app has probably been downloaded quite a few times by virtue of it having been available for many years. Now it's time to introduce another PIM data exporter application: Anyxporter. This new application is capable of exporting contact data, and supports both MeeGo Harmattan and (some versions of) Symbian. One of the shortcomings of SMS Exporter is that its export data format is not as machine readable as it could be.

Read more…

Nokia's Products Are Error (Message) Free

Revised on
Created on

So I upgrade the firmware of my Nokia E71 from v200 something to v300 something. After the upgrade, I proceed to restore my data, as one would. No errors reported, and indeed everything was restored, with the minor exception of all of my 1540 Calendar entries, which were nowhere to be seen. The same thing with restore from memory card and restore with Nokia PC Suite. Sometimes I wish something this important would just work.

Read more…

Passing on Keyword Arguments in PLT Scheme

Written on

I am a big fan of Python’s keyword argument facility, and especially its support for *args and **kwargs function parameter declarations. *args and **kwargs capture any explicitly undeclared positional and keyword arguments, respectively, and this facility in many cases allows one to avoid repeating function interfaces. This is both less typing and more future proof, and makes it easier to see the parameters that directly concern a function. Contrast this with Java, which not only has no keyword arguments, and no support for *args style declarations, but which also forces you to repeat caught exception declarations in function signatures.

Read more…