This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: difficulty of writing translators


> I'm not proposing it as anything. I was just commenting on Per's
> suggestion in a general way. He said he hadn't thought of a way to
> allow setters to be set for user-defined procedures, ...

Er, no.  To quote (from the part you quoted):

>>> Kawa supports this (for some primitive functions - I haven't decided
>>> yet how to define such functions in Scheme).

There is a difference.

My concern is that I would prefer a more declarative way to associate
attributes with procedures, rather than depending on side-effecting
operations.  Apart from that, using (set! (setter PROC) SETTER)
is an elegant solution.

> IMO it is a mostly orthoginal feature to variable tracing and only
> allows you to achieve a few things that superficially look the
> same.

My short-term plans for Kawa include:

(location VARIABLE) ;; returns a first-class location
		    ;; conceptually like C's &VARIABLE
(location (PROC . ARGS)) ;; Returns a functional settable location
(LOCATION)          ;; returns the value of LOCATION, like C's *LOCATION
(set (LOCATION) VALUE) ;; Set the LOCATION to a new VALUE
(define-alias NAME RVALUE)  ;; Define NAME as an alias for RVALUE

With these, you can:
	(define-alias FOO (PROC arg))
Now accessing FOO will call PROC.

More details later, after it has been implemented ...

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner