Hello Eric,

On 2016/01/20 11:43, Eric Wong wrote:
> naruse / airemix.jp wrote:
>> Dir#each and Dir#read) (including Dir.entries, Dir.foreach and other methods) return "." and ".." at first.
>> But through the all real use case "." and ".." are useless.
>> How about excluding them?
>
> If Ruby were a new language, yes.  But I think it is too risky, now.

Can somebody do a code search for this? I know AKR is good at that (but 
I don't want to ask him to do this).

>> +#define DIR_IS_DOT_OR_DOTDOT(dp) ((dp)->d_name[0] == '.' && \
>> +	((dp)->d_name[1] == '\0' || ((dp)->d_name[1] == '.' && (dp)->d_name[2] == '\0')))
>
> Anyways, I prefer we reduce macro usage and use static inline functions
> to avoid potential side effects, extra '\' and parentheses.

Are inline functions now an accepted concept in C? It seems they are 
available from C99, but then so are // comments, and they are not yet 
accepted in Ruby because of some old compilers.

Also, are there C compilers that inline functions as part of 
optimization, even if they aren't marked as such in the source?

While I very much understand your point re. potential side effects, 
using inline functions also may save space at the cost of time, in 
particular for long macros. Is that also one of the reasons you favor them?

Regards,    Martin.

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>