Reputation
265
Top tag
Next privilege 300 Rep.
Create new tags
Badges
1 6
Newest
 Yearling
Impact
~857 people reached

  • 0 posts edited
  • 0 helpful flags
  • 10 votes cast
Jul
15
comment Behaviour of Thread sleep in a single core processor machine?
Can you please include that in the answer? Preemptive multitasking is key for a complete and correct answer, and users shouldn't have to dig through the comments to find the rest of the answer.
Jul
7
comment Connection between futures and exceptions?
Nonetheless, there's no similarity to exceptions. Exceptions unwind up, possibly several stack frames; futures have the effect of suspending the current thread (or fiber, whatever) of execution, then executing potentially in concurrency (e.g. more than one needed future yet without value), and returning to the suspended execution point. For a single future, this could be just a regular call. Anyway, they're so different that you can't implement one over the other.
Jul
7
comment Connection between futures and exceptions?
Ok, I take part of what I said back, futures, as the term originated are about asynchronous processing and concurrency in an attempt to better exploit opportunities for parallelism. Disclaimer: that downvote is not mine.
Jul
6
comment Connection between futures and exceptions?
So, they are only vaguely similar regarding stack unwinding. So, they are not similar at all. This doesn't seem like an honest attempt of trying to answer your own question, it seems more like you thought something up and made up the question. I'm sorry if this sounds rude. Also, mixing asynchronous models and futures just shows up what to expect from Wikipedia articles. If anything, futures are more similar to result-caching delegates (or lambdas). Wait, that was you editing the Wikipedia article!
Jul
6
comment Is overriding Object.finalize() really bad?
The thing is that HasFinalize.stream should itself be a separately finalizable object. That is, the finalization of HasFinalize shouldn't finalize or try to clean-up stream. Or if it should, then it should make stream inaccessible.
Mar
1
comment Which version of Java should I use for a desktop application to reach the most users?
Bundling JRE requires licensing and it's awfully dangerous if the application accesses the internet.
Feb
21
comment `values` vs `list` for returning multiple values from Lisp form
Note that it's completely implementation dependant how the values are actually stored. It could be registers, or on the stack, or a thread-local vector, or a series of thread-local vectors for different amounts of values, or a top-of-the-stack-allocated vector, or a heap-allocated user-hidden vector type (thus no longer saving you from consing), or a freshly consed list in an interpreter, or a combination of these, or yet something else. I've seen a few of these in actual implementations.
Feb
8
comment Language support for (syntactic) delegation in Java
Java 8 has mixins through default interface methods, not really full-fledged multiple inheritance.
Jan
17
comment How come the keyword for declaring a class is 'interface'
So, @interface does not have the same effect as in Java or C# at all, it's much more similar to declaring a class in C++ in a header file and implement it in a code file. Since there's no explanation for the origin of the token @interface versus something else, this is not an answer, it's just reinforcing the op's rgument.
Nov
19
revised Why do functional programs have a correlation between compilation success and correctness?
Minor edit.
Nov
19
revised Why do functional programs have a correlation between compilation success and correctness?
added 176 characters in body
Nov
19
answered Why do functional programs have a correlation between compilation success and correctness?
Oct
25
comment Is it a good practice to run unit tests in version control hooks?
Not if you have a huge repo with big, globally distributed teams. For instance Microsoft uses a similar, more layered approach with Windows.
Oct
25
answered Is it a good practice to run unit tests in version control hooks?
Aug
21
revised Is there any practical use for the empty type in Common Lisp?
Added (or) and (member) equivalence.
Aug
21
comment Is there any practical use for the empty type in Common Lisp?
Consequences are undefined even if the actual data is never effectively used, as in: -- But in that case, the data is effectively accessed, used to create a list of one element. But (length (list (make-array 10 :element-type nil))) should still reliably return 1.
Aug
21
comment Is there any practical use for the empty type in Common Lisp?
I get SBCL's point of view, that the only way to satisfy a nil return type is to not return at all, but it's a deduction or even a choice, since it's undefined behavior (versus clearly meaning the function can't return anything) to deal with a return value that is not of the declared type. So if a compiler can prove such a function may return, it could error on definition, on compilation and/or on load.
Aug
21
comment Is there any practical use for the empty type in Common Lisp?
(1) I don't know, some SBCL error functions are already declared as such, so I guess you can trust SBCL will not error on such declarations. (2) The only reliable, portable way to say that a function returns no values is that, but there is no portable way to say that a function doesn't return at all. (3) Declarations may be completely ignored, but they may also be completely trusted, so it goes that it's implementation dependent, hence you can't trust it won't error, but you can't trust it will error either, and it might error either at the declaration point or during compilation.
Aug
21
comment Is there any practical use for the empty type in Common Lisp?
Just for the record, the rationale behind the need of &optional at the end of a compound values type declaration to declare no further return values has been discussed in one of SBCL's mailing lists. Basically, the presence of lambda list keywords indicates the amount of parameters to a function that would be correctly called with the returned values as if by multiple-value-call. The lack of them allows further return values (of type t). The consequence is that (values &optional) is the only reliable way to declare no return values.
Aug
21
comment Is there any practical use for the empty type in Common Lisp?
I'm not confusing. The way to declare you return no values, is correctly done with (values &optional). With nil, you declare it returns a first value of type nil, which is impossible and the implementation could signal an error or at least a warning right on the declaration. If it was null, the only valid first return value would be nil. There is no portable way to declare that a function doesn't return.