logoalt Hacker News

WalterBrightlast Sunday at 5:16 PM2 repliesview on HN

Zig:

    fn ArrayListType(comptime T: type) type {
D:

    T ArrayListType(T)() {

Replies

do_not_redeemlast Sunday at 6:29 PM

Why is omitting the fact that T is a type useful? T could be a normal value too.

This reminds me of C in the 1970s where the compiler assumed every typo was a new variable of type int. Explicit is good.

show 1 reply
dpassenslast Sunday at 5:39 PM

I don't know D but shouldn't that be

    struct ArrayListType(T) {

?
show 1 reply