Timeline for String templating
Current License: CC BY-SA 3.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 20, 2014 at 9:49 | vote | accept | joojaa | ||
| Jun 28, 2014 at 15:57 | comment | added | Leonid Shifrin | @Szabolcs I had similar strategy for Composition, having instead used my own version of it which wasn't unpacking. I wasn't aware of the fact that Composition no longer unpacks. I just checked on the dev.version, and yes, you are right. Thanks for pointing this out. There is (at least) one more issue with Composition, which is good to know, and which I have discussed here in the section "Fixing some speed problems". I did not re-test now, but it is probably still there. | |
| Jun 28, 2014 at 2:30 | comment | added | Szabolcs | Note to people trying the above unpacking demonstration: Identity is auto-removed by Composition, so it is necessary to use #& in this example. | |
| Jun 28, 2014 at 2:27 | comment | added | Szabolcs | @Leonid One general problem with Composition used to be that it unpacks packed arrays. r = RandomReal[1, 10000]; Composition[Developer`PackedArrayQ, # &][r] I see that this doesn't unpack now in the cloud, which is great news! The unpacking problem was the reason why I made a mental note never to use Composition (after having been bitten a few times). | |
| Jun 26, 2014 at 19:38 | comment | added | Leonid Shifrin | @Kuba I agree. I don't consider this style the most powerful (in the sense that it does not really allow to introduce qualitatively more powerful abstractions), but it can be applied to the majority of tasks where Mathematica shines, and it is still considerably more expressive that the "usual" one where component functions are not singled out explicitly. | |
| Jun 26, 2014 at 19:34 | comment | added | Kuba | @LeonidShifrin Thanks. I find it really useful/readable when it comes to adjusting "code templates" that I'm doing a lot. | |
| Jun 26, 2014 at 19:29 | comment | added | Leonid Shifrin | +1 for using the Composition-style code. It had become my preferred style too, some time ago. New operator forms (curried functions) for many built-in functions in V10 makes this even much easier to use. | |
| Jun 26, 2014 at 11:09 | history | edited | Kuba | CC BY-SA 3.0 | added 53 characters in body |
| Jun 26, 2014 at 11:09 | comment | added | Kuba | @joojaa it's a problem of NumberMarks, corrected now. | |
| Jun 26, 2014 at 11:00 | comment | added | joojaa | Theres only one thing: Why does Mathematica put a 1.5` instead of 1.5 in the second items translate? | |
| Jun 26, 2014 at 10:56 | comment | added | Kuba | @joojaa I'm glad it helps. Feel free to ask if you face any problems. | |
| Jun 26, 2014 at 10:55 | comment | added | joojaa | Excellent, that's much better. Now all i need to do is understand whats going on but that's what the manual is for :) | |
| Jun 26, 2014 at 10:52 | history | answered | Kuba | CC BY-SA 3.0 |