#Should you pass around std.process.Init everywhere?

1 messages · Page 1 of 1 (latest)

jade field
#

Idk, seems really dumb

quaint root
#

No, you trivially pass allocators and Io. Keep "juicy main" part inside of the main

jade field
#

I mean more for args and enviorment variables

quaint root
#

Honestly you should extract/parse these inside of your main or something like that. Then just pass around the struct of options that your application needs. Not just raw environ

jade field
#

ok? So lets say I make a lib that uses idk posix and it uses enviorment vars, should I make the user of the lib pass in all the options for it...

#

What Im trying to say is that libraries are going to have to get in a bunch of paramaters to do simple logic?

#

its like pasing an add function to a math lib

quaint root
#

Why would libraries even depend on the fact that the options are arriving from environ? Sounds stupid and unportable.

jade field
#

yeah?

#

Personaly Id prefer if they just let stuff like std.posix.getenv be

#

mb this is better for #programming-discussion