guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dot expansion


From: Keisuke Nishida
Subject: dot expansion
Date: Sun, 11 Feb 2001 04:15:25 -0500
User-agent: Wanderlust/2.4.0 (Rio) SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) Emacs/21.0.96 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

Hello,

I really would like to introduce the following expansion:

  foo.bar.baz  ->  (baz (bar foo))

So that I can write programs as follows:

  guile> (define-class <foo> ()
           (bar #:accessor bar))
  guile> (define foo (make <foo>))
  guile> (set! foo.bar 1)
  guile> foo.bar
  1
  guile> (set! foo.bar (lambda (x) (* x x)))
  guile> (foo.bar 2)
  4

This REALLY simplifies programming with GOOPS.

What is the best way to do this?  An easy way is to add a module
option and control the reader or loader appropriately.

  (define-module (foo)
    :expand-dot)

May I apply this little dirty hack?

Kei



reply via email to

[Prev in Thread] Current Thread [Next in Thread]