Timeline for How to pass a list of arguments into HoldAll
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 16, 2020 at 9:23 | history | edited | CommunityBot | Commonmark migration | |
| May 23, 2017 at 12:35 | history | edited | CommunityBot | replaced http://stackoverflow.com/ with https://stackoverflow.com/ | |
| Apr 13, 2017 at 12:56 | history | edited | CommunityBot | replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/ | |
| Mar 22, 2013 at 20:37 | comment | added | Leonid Shifrin | @SjoerdC.deVries Actually, it was your question on SaveDefinitions which prompted me to use the technique I described above. If I used it prior to that, I don't remember it. | |
| Mar 22, 2013 at 20:25 | comment | added | Sjoerd C. de Vries | Great, works as a charm. | |
| Mar 22, 2013 at 20:11 | comment | added | Leonid Shifrin | @SjoerdC.deVries Sorry for the syntax, I did not test this one (usually I always test). To address your objection: Hold[argument]/.OwnValues[argument]/.Hold[{args__}]:>..., the rest the same as before. | |
| Mar 22, 2013 at 20:09 | comment | added | Sjoerd C. de Vries | Actually not. Apart from the syntax error (Hold[int[patt]] has a ] too much), you again paste the arguments in the code instead of using the variable (argument) that contains them. I really believe that you should work from the named list as this seems part of the question (the OP mentions a really lengthy list). | |
| Mar 22, 2013 at 19:55 | comment | added | Leonid Shifrin | @SjoerdC.deVries I interpreted the problem so that it is not important how there are initially stored. One could start with the arguments: Unevaluated[{a,b,c}]/.{args__}:> ({a_,b_,c_} /. {patt___} :> SetDelayed @@ Hold[int[patt]], NIntegrate[f[args], {x, 0, 1}]]). Does this address your concern? | |
| Mar 22, 2013 at 19:46 | comment | added | Sjoerd C. de Vries | The OP has the arguments a,b,c in a list. How do you get them from there into the part Hold[a,b,c] of your code at the end (without literally pasting them there of course)? | |
| Mar 22, 2013 at 19:36 | history | edited | Leonid Shifrin | CC BY-SA 3.0 | Some small fixes |
| Mar 22, 2013 at 18:59 | history | answered | Leonid Shifrin | CC BY-SA 3.0 |