2,743 reputation
1227
bio website
location Argentina
age 37
visits member for 3 years, 5 months
seen 20 hours ago

Software developer and science fiction fan.


Jan
13
reviewed Reviewed Dynamic initialization, how does it work?
Jan
11
reviewed Reviewed How to understand codebase of complex opensource application
Jan
11
reviewed No Action Needed How can I automatically test a large, complex spreadsheet?
Jan
9
reviewed No Action Needed Is a development environment required for small projects?
Jan
8
reviewed No Action Needed English term for “Naive user test” or “idiot test”
Jan
8
reviewed No Action Needed Payment Gateways and RESTful API
Jan
7
reviewed Reviewed Phenotropic Program Design
Jan
3
reviewed No Action Needed How should dependencies be managed across a modular application?
Jan
3
reviewed No Action Needed DAL vs BLL functions' return types
Jan
3
reviewed Reviewed At what point is version control needed?
Dec
24
comment Why do most programming languages only support returning a single value from a function?
@Aaronaught Oh, I agree in practice it probably doesn't matter. w is a single value which can be pattern matched to extract the values of x and y, and that's all you need to know. But to the OP it probably mattered...
Dec
24
comment Why do most programming languages only support returning a single value from a function?
@Aaronaught What if the compiler lets you write (x, y) = func(...) but also lets you write w = f(...) for the same function? Is w a single value or multiple ones? If it can be pattern-matched, then it's multiple values?
Dec
24
comment Why do most programming languages only support returning a single value from a function?
@MichaelSiler (I agree with your comment) But please note that argument is reversible: "arguments that program functions can return multiple values because they can return a single tuple value aren't very compelling either" :)
Dec
23
comment Why do most programming languages only support returning a single value from a function?
@badp I meant your definition doesn't side-step anything. The powerset is a single value; you have only one such value for every X in the domain of f, otherwise it cannot be a function. Again, this is highschool-level maths. I also argued that what people usually think of as "not returning multiple values" actually means (in technically limited languages) "only returning primitive values". I didn't mention pointers or calling conventions or any other implementation detail.
Dec
23
comment Why do most programming languages only support returning a single value from a function?
@badp I'm guessing your remark about "multiple outputs" is a confusion (either yours or of the motivating question) caused by early programming languages which had functions that could only return primitive types (such as Integer). Because programmers were used to thinking a tuple cannot be returned by a function, they incorrectly assumed a tuple is not "a single value". A tuple is a value. So is a set. Do not confuse technical limitations of programming languages with mathematical rules/definitions!
Dec
23
comment Why do most programming languages only support returning a single value from a function?
@badp Mathematically the only rule for functions is that they are relations constrained by the rule I quoted. Please not P(Y) (the powerset) is a single element; you are not side-stepping anything.
Dec
23
comment Why do most programming languages only support returning a single value from a function?
@badp "A function f from X to Y is a subset of the cartesian product X × Y subject to the following condition: every element of X is the first component of one and only one ordered pair in the subset". Your example complies with this and doesn't return "multiple outputs", which would violate the definition of function.
Dec
23
comment Why do most programming languages only support returning a single value from a function?
@badp I disagree, your example is still a single output. Mathematical functions with "multiple outputs" do not exist by definition. This is highschool-level math!
Dec
20
reviewed Reviewed Python - defining exit method before importing
Dec
20
reviewed Reviewed Loading data for ShoppingCart item