> On Jun 14, 2018, at 3:23 PM, Marco van de Voort <mar...@stack.nl> wrote: > >> // works with function parameters also. >> // this is almost like a class helper or at very least mimics ?self? in >> methods. >> >> procedure OpenDoor(with var door: TDoor); >> begin >> state := true; // with imports door namespace into entire function scope >> end; > > you set a runtime variable to add a compiletime scope ? I don't understand. > > Is your reference language an interpreter?
the “with” in the parameter is like a “with door do” block inside the entire function scope. I really liked this idea of his because it’s basically something Pascal already does but it’s automatic with this syntax. procedure OpenDoor(var door: TDoor); begin with door do begin state := true; // with imports door namespace into entire function scope end; end; Regards, Ryan Joseph _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal