variable heck

1 view
Skip to first unread message

Raoul Duke

unread,
Nov 16, 2021, 7:49:39 PM11/16/21
to pi...@googlegroups.com
in some code i've been working on of late, there tends to be a lot of
parameters being passed to methods, and with the extra laborious
verbosity of naming every parameter it gets to be a metric sh*tton of
ascii.

also lots of wrapper methods that do 1 thing then pass on 99.9% of all
the arguments to another method (which does the same thing heh).

sometimes i wish i could do something evil like have lexically scoped
automagically pattern matching fill in the blank by matching names
values.

function topLevel(
name: Name,
address: Address,
foobar1: Foobar,
foobar2: Foobar,
barfoo9: Barfoo
) {
}

Raoul Duke

unread,
Nov 16, 2021, 7:50:59 PM11/16/21
to pi...@googlegroups.com
function topLevel(
name: Name,
address: Address,
foobar1: Foobar,
foobar2: Foobar,
barfoo9: Barfoo
) {
foobar1.increment()
nextLevel(@!) // some evil sigil that says "pass along anything that
matches by name + type"???????
}

function nextLevel(
name: Name,
address: Address,
foobar1: Foobar,
foobar2: Foobar,
barfoo9: Barfoo
) {
...
Reply all
Reply to author
Forward
0 new messages