/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1549376805918.jpg (624x875, 245K)

Other urls found in this thread:

gitgud.io
docs.oracle.com/javase/tutorial/java/IandI/hidevariables.html
twitter.com/NSFWRedditVideo

first for subscribe to pewdiepie

nth for Nim!

Translating my Haskell program to C after sucking miles of cock. Next I’m going to change my programming socks and maybe learn APL because I’m gay AND a shitskin.

Attached: 1552342057661.jpg (425x564, 40K)

Why does Jow Forums always post the shittiest OP pictures?

Thinking about adding POD structs to my dynamic language, they would work as follows:
struct Foo = (a, b)
let foo = Foo()
foo.a = 1 // OK
foo.b = 1 // OK
foo.c = 1 // Runtime error

Essentially a hashtable with fixed keys.

your data constructor should take values i think

>runtime error
if this was compile time, a perfect hash table would be nice and fast

That's a good idea, but I'm not sure how would I make some values optional at the time of construction, maybe I could use named arguments a'la Python, where you could so something like:
struct Foo = (a, b)
let foo = Foo(b=2)
foo.a // null
foo.b // number 2