Re: Class methods and class fields
Yes, this scenario makes sense in principle.
No, I wouldn't use Scheme classes to do templates UNLESS the number
of defaults is large and yet overriding a few of them at a time is
needed. Even then, I'd consider keyword arguments with default values
instead to do what you want to do.
And also see Neil's answer.
-- Matthias
On Apr 30, 2008, at 8:02 PM, Eddie Sullivan wrote:
> Well, here's the scenario I had in mind when I originally posed the
> question about class variables. I've since come up with a way to
> accomplish this without using classes at all, so this may be a moot
> point, but here it is.
>
> My idea was an x-expression based template library, where each
> template was enclosed in a class. The concept was based on some
> existing text templating languages, where a template can contain
> "blocks" that a derived template can override, and "parameters"
> that can be set on a per-instance basis. In this case the template
> expression would be associated with the class itself, while the
> parameter values would be associated with an instance.
>
> I wanted a syntax where default block and parameter values could be
> specified in-line in the template rather than as default parameters
> to a function. And I wanted to be able to nest blocks.
(Continue reading)