Comment

Comment by Talinx

Functions make assumptions all the time and there is often no way to specify them except with type information. E. g. one can specify that a function takes a float as input but not that the float has to be in [0.0, 1.0]. Hard to catch with static code analysis.

Idea for implicit parameters:

Implicit parameters are values from somewhere up the call stack. So make an object with a get function:

    Scope.get('Logger')
But then you can get anything. So add a mechanism to put things in there up the call stack:

    logger = Logger()
    Scope.put('Logger', logger)
That's a key-value store with scope levels.
parent Talinx 2 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton