xenpaper icon indicating copy to clipboard operation
xenpaper copied to clipboard

Scopes as an alternative to setters?

Open leithaus opened this issue 2 years ago • 0 comments

Have you tried a syntactic form for parameter scopes? Something like with( ){ … }. Here the scope-object contains all the fields that might be set with setters. Then one could provide some default scope objects and a syntax for describing them .

let in …

where is of the form new( scope ) { : , … , : } mod( ){ : , … , : }

It may be too verbose, but lexical scopes save a lot of confusion around where parameters get set.

leithaus avatar Nov 06 '23 12:11 leithaus