[racket] Preliminary support for Racket on EV3

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Tue Sep 30 12:31:18 EDT 2014

Hej Tomi,

I have attached an example, in which 30s evaluates to (sec 30).

The idea is a follows:

   30s  is an identifier, therefore if 30s is unbound, then 30s is
  a reference to a top-level variable.

  References top top-level variables expand to (#%top . 30s).

  The standard #%top will raise an error (identifier unbound).
  The trick is now to redefined #%top to treat identifiers that
  end with s in a special way.

  See attached for details.

/Jens Axel




2014-09-30 17:11 GMT+02:00 Tomi Pieviläinen <tomi.pievilainen+racket at iki.fi>:
> First apologies to Alexsandro Soares, if I'm intruding, but I wasn't
> sure if you were on the mailing list and you were asking about this in
> June.
>
> I tested how well Racket runs on the Lego Mindstorms EV3 (with
> ev3dev), and found out that there is enough memory on the device to
> get a REPL running.  The loading time is somewhat annoying, but not
> prohibitive. I also started creating a library for using the ev3dev
> kernel exposed file based API. I tested that I can use the color and
> ultrasonic sensors, and motors. The rest is simple from those.
>
> I'm a bit stuck by trying to grok Racket better. I'm thinking about
> possibility to have some kind of "typed literals" for distance, time
> and angle, so that I could use (move-robot 11cm) or (move-robot 11s)
> like calls, instead of having separate functions for time and distance
> variables, or having to create the values with (cm 11) or such.
>
> Not sure if that makes any sense, but I was thinking that it might
> feel more natural and also I'm interested in seeing how easily it
> could be done.
>
> --
> Tomi Pieviläinen, +358 400 487 504
> A: Because it disrupts the natural way of thinking.
> Q: Why is top posting frowned upon?
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users



-- 
--
Jens Axel Søgaard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: units-for-lego.rkt
Type: application/octet-stream
Size: 1680 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20140930/1721c83d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: use-units-for-lego.rkt
Type: application/octet-stream
Size: 49 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20140930/1721c83d/attachment-0001.obj>

Posted on the users mailing list.