Hacker News new | ask | show | jobs
by singularity2001 2107 days ago
I'm envisioning a programming language in which variable names and type names can become one.

So instead of

func call(Person person){} you just have func call(person){}

where person is a known type AND the variable name.

In that scenario 'accuracy' would be a type with known value between 0 and 1.

2 comments

Combine with the JS/TS syntax sugar for objects and

{person}

Is an object person with key person and value person of type Person

what if you have to deal with two persons?
In that case you could have the signature

func call(person#1 person#2){}

Wouldn't it be better if we could give meaningful names instead of 1 and 2?

    function call(person#sender person#receiver)
And at that point we're back to the square one, just remove the # :)