C2 forum

General Category => Ideas => Topic started by: acbaile on September 22, 2018, 03:54:39 AM

Title: deleted
Post by: acbaile on September 22, 2018, 03:54:39 AM
deleted
Title: Re: Cumbersome of struct-functions
Post by: bas on September 24, 2018, 12:28:14 PM
Yes, good one. The choice is between 2 sides:

Both have advantages:
C: allows developer to name 'this' variable
C: does not beak C model of implicit stuff
C++: less typing

In the end, the not breaking of the C model was the most important one..
Title: Re: Cumbersome of struct-functions
Post by: lerno on October 17, 2018, 11:34:28 PM
The explicit argument is fine, the only thing I'm not sure of is the dot separator because at a glance I read that as accessing a variable.

I've thought of using the :: separator of C++:
Code: [Select]
func void Point::add(Point* p, i32 x) {
   p.x = x;
}

This adds quite a bit of readability for me.
Title: Re: Cumbersome of struct-functions
Post by: bas on October 18, 2018, 08:56:12 PM
What did you study? Arts? A + is simply a +.