Timeline for Shorter syntax for Fold and FoldList?
Current License: CC BY-SA 3.0
26 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 16, 2020 at 9:23 | history | edited | CommunityBot | Commonmark migration | |
| Apr 13, 2017 at 12:55 | history | edited | CommunityBot | replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/ | |
| Jul 1, 2015 at 17:40 | history | edited | Mr.Wizard | CC BY-SA 3.0 | added 40 characters in body |
| Jul 1, 2015 at 16:50 | history | edited | Mr.Wizard | CC BY-SA 3.0 | added 27 characters in body |
| Jan 2, 2015 at 11:03 | comment | added | user21 | @Mr.Wizard, I was not involved in the operator form implementation, but I'll forward that as a suggestion. | |
| Jan 2, 2015 at 2:31 | comment | added | Mr.Wizard | @user21 Is there now any reason not to implement an operator form for Fold such that Fold[fn][list] is equivalent to Fold[fn, list]? | |
| Dec 17, 2014 at 3:39 | history | edited | Mr.Wizard | CC BY-SA 3.0 | added 265 characters in body |
| Dec 17, 2014 at 3:36 | comment | added | Mr.Wizard | @Naitree Thanks for the note! | |
| Dec 17, 2014 at 3:11 | comment | added | Naitree | Hi again, @Mr.Wizard. I found out that two-argument form of Fold and FoldList has been offically documented in 10.0.2. See details section of their docs. :) | |
| Oct 26, 2014 at 21:05 | comment | added | Mr.Wizard | @Naitree Ah, that's correct. It is evaluated every time a kernel (without -noinit) is started, so if you terminate and restart a kernel or launch a new one your definitions should be loaded. | |
| Oct 26, 2014 at 12:19 | comment | added | Naitree | @Mr.Wizard I realized that init.m is evaluated automatically when the first input line of the session is being sent to the kernel. Not immediately after system start-up. So I think it actually works fine... :-) | |
| Oct 25, 2014 at 19:44 | comment | added | Mr.Wizard | @Naitree Strange that your Kernel/init.m file isn't auto-loading. It is possible to suppress loading with kernel launch flag -noinit as can be set from Kernel Configuration Options... but you would probably remember if you had set that. If the problem persists I suggest you post a Question about it as other people may have more ideas. (I cannot recall having that problem.) Side note: it should be sufficient to use <<CustomDefinitions.m to load your package from that path as it should be in the $Path list. | |
| Oct 25, 2014 at 16:48 | comment | added | Naitree | @Mr.Wizard Following your thorough instructions, I have successfully created a package file named CustomDefinitions.m under $UserBaseDirectory/Applications, and put <<CustomDefinitions/CustomDefinitions.m in the init.m file which is under $UserBaseDirectory/Kernel. However, strangely I found out that the init.m file won't load automatically when I restarted Mma. I mean, the init.m takes effect only if I manually kick <<init.m after a fresh start of Mma. Also, I have checked that the default contexts of both init.m and Untitled-1 are Global. Any suggestions? | |
| Oct 25, 2014 at 5:07 | comment | added | Mr.Wizard | @Naitree By the way: be careful with modifying System functions. There is a reasonable school of thought that says you should never do it. There are usually alternatives, e.g. one could create a MyTools`Fold function and let this supersede the System`Fold function for interactive input. Also be aware that in some cases your modifications may be undone by internal (re)loading; see: (32531), (63656). | |
| Oct 25, 2014 at 5:01 | comment | added | Mr.Wizard | For modifications to System` symbols you do not need to create a new Context but for your own functions I believe that you should. However be aware that this can complicate access to your own functions from Cell contexts etc.; see: (9571) and (13293). Let me know if you run into any problems and I'll try to help, or just post a Question about it. | |
| Oct 25, 2014 at 5:00 | comment | added | Mr.Wizard | @Naitree I'll tell you what I do. I use a single line in init.m to load a package which contains my own functions and customizations. This makes it easy to "comment out" that line if needed. I create, update, and manage the .m package file from a companion Notebook (.nb) with Initialization Cells; when you save such a Notebook for the first time it should ask you if you want to create a Package. I save this Notebook/Package to the Applications directory under $UserBaseDirectory. (continued) | |
| Oct 25, 2014 at 4:41 | comment | added | Naitree | @Mr.Wizard How can I save the custom definitions for built-in symbols permanently? Is it init.m the correct choice? I searched the site but maybe I just couldn't pick a right keyword to the answer. | |
| Jul 17, 2014 at 10:27 | vote | accept | Mr.Wizard | ||
| Jul 14, 2014 at 8:51 | comment | added | user21 | @YiWang, I think, IIRC, it works from V9 onward. | |
| Jul 14, 2014 at 8:48 | comment | added | Mr.Wizard | @user21 I'm terribly sorry if I forgot or somehow confounded you with someone else. (I have a very poor memory as I keep telling people.) Many thanks for getting this done! | |
| Jul 14, 2014 at 8:36 | comment | added | Yi Wang | It already works in M9 (Feb 7 2013 build). | |
| Jul 14, 2014 at 8:33 | comment | added | user21 | @Mr.Wizard, I thought we had a discussion about it a while back - perhaps I forgot to mention that I could sneak it in;-) I am glad you like it. | |
| Jul 14, 2014 at 7:57 | history | edited | Mr.Wizard | CC BY-SA 3.0 | added 70 characters in body |
| Jul 14, 2014 at 7:46 | history | edited | Mr.Wizard | CC BY-SA 3.0 | added 180 characters in body |
| Jul 14, 2014 at 7:41 | comment | added | Yi Wang | Interesting! Thanks a lot for sharing! | |
| Jul 14, 2014 at 7:37 | history | answered | Mr.Wizard | CC BY-SA 3.0 |