Re: Wolfram User Interface Research?
- To: mathgroup at smc.vnet.net
- Subject: [mg88022] Re: Wolfram User Interface Research?
- From: Will Robertson <wspr81 at gmail.com>
- Date: Tue, 22 Apr 2008 06:27:15 -0400 (EDT)
- References: <fuhfdc$ihb$1@smc.vnet.net> <fuhrka$s88$1@smc.vnet.net> <fuimva$9jv$1@smc.vnet.net>
On 2008-04-22 04:08:34 +0930, AES <siegman at stanford.edu> said: >> together and create an unreadable mess --- but of course, if you did >> exactly the same thing with the FullForm equivalents then the result >> would be just as hard to read, if not more so. > > Don't agree with you on this -- but nonetheless will take your further > comment to heart and go off and finally learn how to use @ . Oh, I just meant to say that you're better off splitting things up into chunks and commenting each part if it doesn't make any sense. Here's some code of which I'm not particularly proud but which, kind of, demonstrates this idea: ListCombinations[in_List, AND_, NOT_] := Module[{s, x},=E2=80=A8 s == Tuples[{# &, NOT[#] &}, Length@in];=E2=80=A8 s = Thread[MyApply[#, i= n]] & /@ s /. MyApply[x_, y_] -> x[y];=E2=80=A8 s = AND @@ # & /@ s;=E2=80=A8= Most@s (* Last element is "NOT all" -- we're not using that one *)=E2=80=A8 ] ListCombinations[{a, b, c}, And, Not] If I'd chained all those s= into a single statement (which is probably how I wrote it, however long ago) it would be even harder to read (and that second line is pretty messy), regardless of whether those @@ and & and /. were Apply[], Function[], Replace[], and so on. Cheers, Will