225 reputation
16
bio website
location Faro, Portugal
age 32
visits member for 2 years
seen 13 hours ago

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.
Aug
20
comment Is there any practical use for the empty type in Common Lisp?
(function ... nil) declares a function that returns a value of type nil. To declare a function that returns no values, it's (function ... (values &optional)). Also, it's undefined behavior to access uninitialized array elements.
Aug
20
answered Is there any practical use for the empty type in Common Lisp?
Jul
3
comment How does the “Fourth Dimension” work with arrays?
Since we don't know the actual physical constraints in terms of dimensions, only our own perception, I suggest you reword the answer, something like replacing "the physical constraints of the real world" with "the human constraints on understanding further dimensions". Another one, "Arrays aren't stored in physical space", they are, so "Arrays aren't stored in as many physical dimensions as their own" would make a whole lot more sense.
Jul
2
comment How does the “Fourth Dimension” work with arrays?
Computer arrays are not limited by human comprehension or visualization, but they're limited by physical constraints, e.g. an array of d dimensions each of length n will take n^d, or more generally with different length dimensions, n1 × n2 × … × nd.
Jun
18
comment Mental Models or Real-World-Metaphors for Functional Programming
This metaphor only makes sense in the "first-class functions/function composition" meaning of "function programming", not in the "no side-effects/declarative". Also, object-oriented programming doesn't necessarily have side-effects, so you can implement either a destructive or constructive assembly line with either OOP or this meaning of FP. OOP is more about encapsulation, message passing and polymorphism than it is about side-effects, it depends on how you model things. E.g. do you require referencial identity from start to end?
Jun
18
comment Mental Models or Real-World-Metaphors for Functional Programming
Which concrete meaning of "functional programming" are you referring to, "no side-effects/declarative" or "first-class functions/function composition"? Or both?
Oct
19
awarded  Yearling
Oct
18
revised What am I risking if I don't update my SDK/JDK and bundled runtime/JRE every time there's a security update?
Added server risk
Oct
18
answered What am I risking if I don't update my SDK/JDK and bundled runtime/JRE every time there's a security update?
Oct
4
comment xml based programming languages
@MasonWheeler, injection is executing data that should not execute. Homoiconicity means code and data are much alike, in literal form and in programmatic manipulation. A homoiconic languages may securely manipulate and execute (code generated from) trusted data, be it hard-coded in your source code or otherwise. In e.g. Common Lisp, you can include data in generated code without it being executed, such as (eval `(foo (quote ,data))). Your argument about parameters vs. escaping may be right, but you missed the point.
Feb
28
awarded  Caucus
Feb
21
comment Linux Programmer moving to Windows
@AdamAdamaszek, point taken. You were talking about user experience and I was talking about developer experience, and probably that wasn't clear. More specifically, I was talking about the lack of file-alike traits of console handles. Actually, it's serendipity finding out about Gow through your comment. I use Gnuwin32, but it's a bit outdated by now.
Feb
21
comment Linux Programmer moving to Windows
@AdamAdamaszek, I correct myself, ConEmu and clink both seem to hook on certain DLL entry points, such as WriteConsoleW. Still...
Feb
21
comment Linux Programmer moving to Windows
@AdamAdamaszek, so, you have to install and combine 3 things to emulate *nix TTYs at the user level, and in the end, asynchronous I/O is still an exception. How does that make the last paragraph obsolete? That basically just means one of those components implements a raw console input handler. If you're given a console input handle, you're stuck with synchronous I/O, and at best you can have just 1 dedicated thread, knowing that there's only one console per process, to handle console I/O, probably with a queue or two.