« first day (235 days earlier)      last day (1561 days later) » 

6:19 AM
@marmot I hope Christian Feuers¨anger put this command to a new package, say, pgfplotsfor, or pgfungroupedfor :) It is just really necessary in some cases.
 
 
2 hours later…
user11685757
7:51 AM
@JouleV I was told he is not active these days.
 
8:28 AM
@JouleV you could create such a package with proper attribution.
 
user11685757
For many things the good old `\@for` is actually great, and it is fast. I am starting to collect some tools like
\pgfmathdeclarefunction{Dim}{1}{%
\begingroup%
\pgfutil@tempcnta0%
\@for\pgfutil@tempa:=#1\do{\advance\pgfutil@tempcnta1}%
\edef\pgfmathresult{\the\pgfutil@tempcnta}%
\pgfmathsmuggle\pgfmathresult\endgroup%
}
One can define sums and many things in this way.
 
@marmot are you sure this was directed to me? It sounds like it should have been directed to @JouleV (but I'm not sure)
 
user11685757
@Skillmon This is just a random statement. Yes, it was meant to go to both you and @JouleV.
 
@marmot As I'm often coding in expl3 in the first place, I can happily use things like \clist_map_inline:nn and am done :) And if I'm not using expl3 this means that I'm often after optimal performance or writing generic code, so I can't use \@for most of the time for this. Nevertheless, I use it, too, but only in a few occasions (ducksay documentation uses it, for example, but not the package code).
 
 
8 hours later…
user11685757
4:43 PM
@Skillmon I have two really major problems with \clist_map_inline:nn. First, you need to wrap things in a macro since surely you need \ExplSyntaxOn and \ExplSyntaxOff. Second, AFAIK it does not understand the ... which \foreach \X in {1,3,...,19} does.
 
@marmot yes, but if you want to step numbers you can use \int_step_inline:nn(nn). The one thing which really isn't contained in expl3 that \foreach is able to is \foreach\x/\y in {a/b,c/d}.
 
user11685757
@Skillmon Well, you can say \foreach \X in {1,3,...,19,25,27,...,39,37,35,...,1}` and so on (also \foreach \X in {A,...,F}).
 
@marmot oh, didn't know multiple usages of ... were possible.
 
5:14 PM
@marmot the dot syntax is higher level user syntax, \clist_map_inline is a low-level programming tool. You would have to (and could) write a user command for this.
 
user11685757
@UlrikeFischer The question is whether a random user would want to do that (given that this already exists).
 
9:21 PM
@marmot no, but the tools are not for random user, they are for programmers. You only need to run a benchmark, to see the difference:
\documentclass{article}
\usepackage{tikz,l3benchmark}

\begin{document}
\ExplSyntaxOn
\benchmark:n { \foreach \X in {1,2,...,19} {x}}

\benchmark:n { \int_step_inline:nn {1}{19}{x} }

\ExplSyntaxOff
\end{document}
 
 
1 hour later…
user11685757
10:44 PM
@UlrikeFischer Yes, thanks, that's all great but you cannot easily blend it into other stuff, e.g.
\documentclass{article}
\usepackage{pgffor}
\begin{document}
\begin{itemize}
\foreach \X in {i,a,m,a,c,a,t}
{\item \X}
\end{itemize}
\end{document}
 
user11685757
I know of course you can do the full thing with expl3 but you'd always have to define a macro that you "smuggle" out of the \ExplSyntaxOn ... \ExplSyntaxOff regime, or do the thing inside but then you run into trouble with math expressions and so on. It is just not user friendly enough at this point to do cook up some code real quick.
 

« first day (235 days earlier)      last day (1561 days later) »