[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Let's talk about order of assignment
- From: Tom N Harris <telliamed@...>
- Date: Thu, 18 Sep 2014 16:17:20 -0400
On Wednesday, September 17, 2014 03:34:39 PM Sean Conner wrote:
> I'm guilty of that. My POSIX process libary [1] allows:
>
> process.limits.hard.core = "20m"
>
> but behind the scenes it turns that into a call to setrlimit(). I find
> "assigning" the values more intuitive than knowing how to call the
> setrlimit() function. Conversely, reading process.limits.hard.core in turn
> calls getrlimit().
I was perhaps overly strict in my criticism. The call to setrlimit is sensible
as it is a different way of assigning a known value (20 megabytes... except
the lower-case 'm' irks me very slightly) to a known something-like-an-lvalue,
which is a value in the kernel.
The confusion I was thinking of is where an assignment statement does
something that is not in any way like an assignment. For example, I wouldn't
be comfortable using a HTTP library like this:
local connection = http.new()
connection.get = "http://www.lua.org/" -- send a request
html.parse(connection.get) -- read result
--
tom <telliamed@whoopdedo.org>