[PATCH 0/8] Implement a new DTS Source Language

Scott Wood scottwood at freescale.com
Fri Sep 26 01:25:07 EST 2008


David Gibson wrote:
>> /define/ make_cpu(\cpu)
> 
> Eck.  The \identified parameters certainly seem to violate the
> look-like-C principle.

It's to disambiguate from existing doesn't-look-like-C constructs 
(property and node definitions), though it's not really needed in this 
context.

>> {
>> 		device_type = "cpu";
>> 		reg = < (\cpu) >;
> 
> So.. in the node name the \cpu parameter is treated as a string, here
> it's treated as a number.  What makes the difference?  Does the %
> operator implicitly convert?

Yes, it implicitly converts.

> Can you define multiple nodes with one
> function.  Can you define properties only with a function?

Yes to both.

>> 			for \i in 0 .. 3 {
> 
> This would seem to be another violation of the look-like-C principle.

I don't think we particularly need to inherit C's warts.

> This for syntax is pretty much unprecedented.

It's similar to Python, albeit with less flexibility (I suggested to Jon 
that we introduce a "set" construct to remedy this).

-Scott



More information about the devicetree-discuss mailing list