Reputation
80,208
Next tag badge:
288/100 score
18/20 answers
Badges
8 235 330
Newest
 Good Answer
Impact
~555k people reached

Jul
24
comment Button evaluation inside DynamicModule
You can use ff[]:=... and then ff[] instead of ff inside the button code, and that will work. This does not explain however why OwnValues don't work.
Jul
24
comment Getting serious about Mathematica programming
I have been working on a system which would address at least some of these issues. Basically, it is a FE-based IDE with the ability to host your code in Github gists, and therefore have an easy to use VCS tightly integrated into it, and therefore multi-computer use too. It also will have multiple undo, and hopefully a plugin system (so that task management could be added as a plugin). Right now I do some of my development in it, but it is not quite finished. There have been several recent related discussions on meta, chat and elsewhere, so I plan to post the minimally working version very soon
Jul
24
comment Why does list assignment with a packed array result in unpacked values?
@Mr.Wizard Map only unpacked because the length of the list was smaller than "MapCompileLength" setting. And Outer is rather inelegant, I agree.
Jul
23
comment Why does list assignment with a packed array result in unpacked values?
@MichaelE2 I would agree that the special case of List was probably considered not important. In fact, the only reason one would want to do List @@ packed would be if one wants to unpack one level. It also seems to be the only way to do this (i.e. using Apply), if one wants to only unpack one level.
Jul
22
comment Short circuit logical operators
@user12677 Was glad to help. Thanks for the accept.
Jul
22
comment Why does list assignment with a packed array result in unpacked values?
@m_goldberg Because Apply does unpack the top level of the packed array. It does it always, even if the head to be applied is also a List.
Jul
22
comment Short circuit logical operators
@user12677 Well, if you have a list, then the generalization is rather trivial: makeIterator[lst_List] := With[{len = Length[lst]}, Module[{n = 1},Function[If[n <= len, lst[[n++]], Null]]]].
Jul
22
comment Short circuit logical operators
@user12677 It is possible in cases when you can enumerate your set in some way - provide a next operator that would, when applied to a current element, produce the next element, for some specific ordering of your set. It should be such that repeated application of next would exhaust your set. So, if such an ordering and an operator exist (if you can construct them), then this will work. Of course, if you already have a list of elements, it will induce a natural ordering by position, but this is a special case.
Jul
22
revised Short circuit logical operators
Structured the answer
Jul
22
comment Specifying optional arguments with variables
@Kuba Sorry, I don't have as much time these days as I used to :). When I happen to pass by and have some time, and if I believe that my answer can add something, I answer. Sometimes, I answer when I feel that I know the answer and that there may also be incorrect or incomplete answers, because the subject matter is tricky or something. And sometimes, I answer when there is a question for which I either have some code from the past, or which interests me in its own right. So, let's wait for more questions :).
Jul
22
comment Specifying optional arguments with variables
@bobthechemist Well, thanks in any case, good that it helped. This was one of the questions that would have to pop up here on SE sooner or later.
Jul
22
answered Short circuit logical operators
Jul
22
comment Specifying optional arguments with variables
@rcollyer Well, sorry to hear that. The answer was also on SO, but my version was only in comments to Brett's answer, and one has to remember which question was that. In fact, since it was in comments, it took me some time to find that discussion now. I only managed to do find it because I remembered who posted one of the answers to that question (Brett).
Jul
22
comment Specifying optional arguments with variables
@bobthechemist Glad I could help, and thanks for the accept. I think this was the fastest accept for any of my answers - within 3 minutes of posting the answer :). You could have waited for some time with accepting though, to encourage others to contribute more answers. As for the subject matter, this actually seems to be one of these issues which look very simple once we know the answer, but actually are not so simple. I seem to remember that it took me some time to figure this out when I asked myself the same question, back when I didn't know the answer.
Jul
22
answered Specifying optional arguments with variables
Jul
22
comment Specifying optional arguments with variables
All you have to do is to define your function before var has any value, or use Block, such as Block[{var}, f[a_:var]:={a}]. See also this answer and a discussion in comments below it.
Jul
22
comment Overlapping pure functions
+1. Just so everyone who didn't yet encounter this knows, it is good to be aware that pure functions with named arguments may exhibit certain scoping issues due to the imperfect nature of lexical scoping emulation used for Function. I have discussed this e.g. in this answer to a similar question asked on SO.
Jul
22
comment Overlapping pure functions
Strongly related question
Jul
21
reviewed Approve Is there such a command like FindZero[f[x],{x,1}]?
Jul
21
comment How can I define a function taking two distinguishable sets of options?
Seems to be a duplicate of this. At least,my answer there describes what I would personally do in this case.