ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* upload
@ 2021-12-03 14:29 Hans Hagen via ntg-context
  2021-12-06  4:41 ` upload Jairo A. del Rio via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen via ntg-context @ 2021-12-03 14:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen

Hi,

a new upload

- some keywords renamed in the engine and therefore more split between 
mkiv and lmtx (hopefully i included all files) .. if something doesn't 
work any more it might be because i missed a rename.

- i finally decied that it does make sense to have native loops at the 
primitive level (after all, metapost as macro language also has them) 
and although much is possible in macros it doesn't mean we have to do it 
the (often ugly and showing-off-by-abusing-side-effects way).

We have just a constructor:

   \unexpandedloop      1 100 1 {.}

and a fully expandable one for e.g. use in \edef:

   \expandedloop        1 100 1 {.}

plus an also fully expandable one for anywhere but with potential side 
effects (out of order local loops):

   \localcontrolledloop 1 100 1 {.}

complemented by a few status primitives (integers, use \the or \number 
to serialize them):

   \currentloopiterator
   \currentloopnesting

and a quitter that aborts at the next iteration:

   \quitloop

as usual it's experimental for a while. Among the rationales are 'less 
tracing clutter', 'performance' and 'more natural primitive tex coding' 
(but that one is personal).

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: upload
  2021-12-03 14:29 upload Hans Hagen via ntg-context
@ 2021-12-06  4:41 ` Jairo A. del Rio via ntg-context
  2021-12-06 10:56   ` [DKIM] upload Hans Hagen via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Jairo A. del Rio via ntg-context @ 2021-12-06  4:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Jairo A. del Rio


[-- Attachment #1.1: Type: text/plain, Size: 2608 bytes --]

Hi, Hans. I've got a question. Negative steps are treated as positive:

\starttext
\expandedloop 10 0 -2 {\the\currentloopiterator\ }
\stoptext

gives

0 2 4 6 8 10

Is this expected behavior? If so, it would be fine to have something more
alike to MetaPost's "for ... step ... until" loop. Thank you in advance.

Regards,

Jairo

El vie, 3 dic 2021 a la(s) 09:29, Hans Hagen via ntg-context (
ntg-context@ntg.nl) escribió:

> Hi,
>
> a new upload
>
> - some keywords renamed in the engine and therefore more split between
> mkiv and lmtx (hopefully i included all files) .. if something doesn't
> work any more it might be because i missed a rename.
>
> - i finally decied that it does make sense to have native loops at the
> primitive level (after all, metapost as macro language also has them)
> and although much is possible in macros it doesn't mean we have to do it
> the (often ugly and showing-off-by-abusing-side-effects way).
>
> We have just a constructor:
>
>    \unexpandedloop      1 100 1 {.}
>
> and a fully expandable one for e.g. use in \edef:
>
>    \expandedloop        1 100 1 {.}
>
> plus an also fully expandable one for anywhere but with potential side
> effects (out of order local loops):
>
>    \localcontrolledloop 1 100 1 {.}
>
> complemented by a few status primitives (integers, use \the or \number
> to serialize them):
>
>    \currentloopiterator
>    \currentloopnesting
>
> and a quitter that aborts at the next iteration:
>
>    \quitloop
>
> as usual it's experimental for a while. Among the rationales are 'less
> tracing clutter', 'performance' and 'more natural primitive tex coding'
> (but that one is personal).
>
> Hans
>
> -----------------------------------------------------------------
>                                            Hans Hagen | PRAGMA ADE
>                Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>         tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 3790 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [DKIM] Re:  upload
  2021-12-06  4:41 ` upload Jairo A. del Rio via ntg-context
@ 2021-12-06 10:56   ` Hans Hagen via ntg-context
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Hagen via ntg-context @ 2021-12-06 10:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen

On 12/6/2021 5:41 AM, Jairo A. del Rio via ntg-context wrote:
> Hi, Hans. I've got a question. Negative steps are treated as positive:
> 
> \starttext
> \expandedloop 10 0 -2 {\the\currentloopiterator\ }
> \stoptext
> 
> gives
> 
> 0 2 4 6 8 10
> 
> Is this expected behavior? If so, it would be fine to have something 
> more alike to MetaPost's "for ... step ... until" loop. Thank you in 
> advance.
already fixed here but no upload for a few days

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-06 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 14:29 upload Hans Hagen via ntg-context
2021-12-06  4:41 ` upload Jairo A. del Rio via ntg-context
2021-12-06 10:56   ` [DKIM] upload Hans Hagen via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).