From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/25849 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: Type of the `filter' argument to traversal functions Date: Wed, 12 Aug 2020 10:22:02 +0200 Message-ID: References: <20200811220909.e97f97ce8e8dad5d575d90f6@gmail.com> <20200812004617.ec382d94b849e234bbaa6762@gmail.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000009bee9b05aca9e27a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39846"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBOGNZ34QKGQEUTY5YDI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Aug 12 10:22:19 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wr1-f55.google.com ([209.85.221.55]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k5m1b-000AGO-0i for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 12 Aug 2020 10:22:19 +0200 Original-Received: by mail-wr1-f55.google.com with SMTP id e14sf605438wrr.7 for ; Wed, 12 Aug 2020 01:22:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1597220538; cv=pass; d=google.com; s=arc-20160816; b=FG1Bd2cdSilxkbuuf3pJ3vgObIzFK34VApWhxz34ACi58i73wDhGzI41xm5zPm7FU+ hlWX3w4RtNDaopA4k4j6a8rdCWvup2ylZ14JUrgnUi2ksNmlRvEMC3ShKjcAJnrn75/Q T19naS5GwwdePKg6x/72odY56sXBKpeY6NPQk75SHwQEUQXzwgABWm/lOR0M5xY3TOuB wIoM638sMKq0eRys9Uo8zXcUUwsW3qU8zFmMcvrETcR5ocLqAGH+HdeZusLScGGVrBW3 AMnCGsuN9T6alIOPHaIBjD4WqifEgeP4mZ5+q114LZQQEqjs7Ipb7l9Kyr67uUrnHCbn 59nA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=+YwaFXpLrnh39CdPyyx5CQ9RNCoLcFr4EjgiTZ5UCDU=; b=CDaH7n15D6ka9K1ARXyVAIVCR8BwIZnEGLyp07sZkW7Yq1tG8DuaaSWWYs2mzVsVy9 6sIW6VV3S9kqZYzQJDVJXbqwcBzcmsJIVkb15Y9yDtose4y+bL1Eh01enb4vRwnECZi5 F9pObkNNbNX5tWE4kp5+O7ax+2LhDR4hVC1gXZ41VYHMTtOP/z1E+xop7t+8YVAUI1Hj 1mc1kON5uX9FJUl7ZQvZMtM85YbHRr+/GqrPkl+JJ9GmMttciBhtr6XGHeS6Q8p2K+yo 5zjoJRI+CjZ0jWsHvZsaalsxlhcapU6H6m6CQceMh1UpV0SAsmj8axMV0xwYdtDFcvl/ KeTQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rsf4aSWZ; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::235 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:references:in-reply-to:from:date:message-id :subject:to:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=+YwaFXpLrnh39CdPyyx5CQ9RNCoLcFr4EjgiTZ5UCDU=; b=mo4iNbTaasopAgpqTqkMF5JKIwJL6CddzcwMaE2jacv5xWuyCAUWM7jTKE4t2Mgtt0 c+Ixa+cS9CkcQLb3hgdau0/4K5hawd+UOG2iQboeaDQ1gqXpLMZ3GN3mXYI2XrNAeg93 7plguQr2kBslB5PiaXb1ETaAwFffNti90cgG9uqtqoOecuLn3fyb6AusgC8AvuNoHcrx 6tofhtFc1SNFf1jcv0cW8EJXOQce+RQa++lOXKbu85/g4LTtGv6PZDz5vpXuvicLgto4 xmW6qSAswKRDv2AoPV7v2419gj3irHdiohMsKxpRXvp38v771/QmXUZbhdtDjmNPpT2B HJSg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=+YwaFXpLrnh39CdPyyx5CQ9RNCoLcFr4EjgiTZ5UCDU=; b=PyWV9t5nO/wqZVV2i29W22pHlDt9DiAEWQC+oTqGCdIYP5C7jZHHPDQf62fM5o/3gk WRiUF9gZG7y+gMj0PwwTbEi1/ugKzhQlHsrg/INZhl3f0o2OdxICJQoF7FqJHPBsz84z Fn2fxgoEOYrD7U5tR8dA9KMVvBCzQj0igmW2kDZHPHNNk1AN+yVQQoT+hthsiUDI+M1g qzkbyxxzhASOviNxw7lASsoBVSkhHSGA4pbwNkY9yffna4TFM6BCL0FNpSMljA+NYpNf CBTtktuju6XsAaH2P7BhpTlM4DlRebUboDnK0cfxJZ960ywVMEmY9JofB1QTd/A/atvz s8Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:references:in-reply-to:from :date:message-id:subject:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=+YwaFXpLrnh39CdPyyx5CQ9RNCoLcFr4EjgiTZ5UCDU=; b=pfdhd7tIkdgccFiaL/a/imVWRMl8x1KZfYlx2fAyzfNnuZu/sU0ZqbKi8UoUzGWk3O B6NgV1w9XU/ljCYDDVXsZwgpBtg3GGIRx9lQLFJe0K+SxKhyXYQZzFaC4MK3OwlIXuoR p/yYAYB8u7xxADUlgw9JZ7HcpKDnPg+nmA0ngMsiDzO8ct02xG+ZliXrFfG2N4DV+Yj/ 6eqwG72Wc0MBy3eHmGx4hXHYW1MNhguMAhR/9yjEPETNI6P2+akzM2tb3UyzM6bRkOUl 4fc49fmhtQzXH0ku+rDGBr4aXBLAVwZ3XjPeY7/nK+wRA9ASB4SXAClKwQkctTLbkhJf dsZw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531Z4lbXX7ZdheCaT7IAQ1MXpR0QyURFVqReRJ73ZQI/RyGb0RsZ 4rh9k9p4Yj+BpU8cCLvrN7c= X-Google-Smtp-Source: ABdhPJzTtkupFjvW2T9DOq8vF2LeQRUj2IwPwM8PnRSBBnaZXb9HaC9bJAyA5TAss+zzOlHe3Twn5w== X-Received: by 2002:a5d:4610:: with SMTP id t16mr34307757wrq.101.1597220538700; Wed, 12 Aug 2020 01:22:18 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a1c:a50e:: with SMTP id o14ls560656wme.3.gmail; Wed, 12 Aug 2020 01:22:15 -0700 (PDT) X-Received: by 2002:a1c:80c1:: with SMTP id b184mr7903749wmd.121.1597220535654; Wed, 12 Aug 2020 01:22:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597220535; cv=none; d=google.com; s=arc-20160816; b=YL7eZmpV6CfunDsjHVJF0FkbMXhOaVxKqi/X9j/50E6dRJFZwroWru16FNIaQDAeDL U64jP4TBajdiv3eBikTuhxuUfmkLkJLLq61j7Fzt7dFF1LBwE5qKkHEj3PO+9O7NEq77 sse7VU+9UEncHUD41La5SH/swW3cygnToJy6OOB0kRFxC6o0AZgHrOUSsQ1svqZJY5br Jq5SBgT1lqE18dya2roJcn1XOFYUZ1JeVQi8A3ygSIvh8QAO9Zqgkk71AdGqYt0o77R1 kyrCM0WOBEw41WyGsAg0Nn1uwogmiIUW87HC7l0fHoeycjl3cZ6yt0z3+3JCVHGiyRmz YE1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=iI065ujRVUlYWEKyiJiHpCNiS6ORq3ecp+vJqp20G+4=; b=M0VpOUW9Kdgs8no9nngliI1PX1ZT8wMerl7IDBCYdS7XgVlKNbe/xKefQ4+aWR1VH/ vefk5zbzX+KKatgclYQnTDzL7b3vKReQK5szTXayCRBuDE8emEfSravXiOxt31sy7pON REz1/CoHyxUliXJKQfO5dB1mYquXd0tvkyGP7jN9m/zHyjJ0nTIA62HVquKwToKZGG3S LpefV1DrydDD8i8u0I+ceiPKN3YUYQ0qARodQeon6+F+iDxLndI5O5JpAWwsjmANk23m fgwjJbTuqgQm3f19wqaYA2sKpkxUTPyEiiXJNbp5pzok3STaJdPv+/xiKM3giOQUngfN qCfw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rsf4aSWZ; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::235 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com. [2a00:1450:4864:20::235]) by gmr-mx.google.com with ESMTPS id w6si94945wmk.2.2020.08.12.01.22.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Aug 2020 01:22:15 -0700 (PDT) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::235 as permitted sender) client-ip=2a00:1450:4864:20::235; Original-Received: by mail-lj1-x235.google.com with SMTP id i10so1287615ljn.2 for ; Wed, 12 Aug 2020 01:22:15 -0700 (PDT) X-Received: by 2002:a2e:80cd:: with SMTP id r13mr4692773ljg.148.1597220534872; Wed, 12 Aug 2020 01:22:14 -0700 (PDT) In-Reply-To: X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rsf4aSWZ; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::235 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:25849 Archived-At: --0000000000009bee9b05aca9e27a Content-Type: text/plain; charset="UTF-8" I wrote: > why it is useful that a filter script can return an array of filters That should obviously have been "must return"! Sorry for any confusion! -- Better --help|less than helpless Den ons 12 aug. 2020 10:19BPJ skrev: > I suppose that it might be worth pointing out that the reason why it is > useful that a filter script can return an array of filters is explained > here: > > https://pandoc.org/lua-filters.html#execution-order > > A note on terminology: Since "table" on its own is rather ambiguous in Lua may > be a good idea to clarify what kind of data a it given table is supposed > to contain by using the terms "array table" and "map table" and possibly > "mixed table" for a table with both array and map data, which are sometimes > convenient in Lua code, e.g. to tag an array. > > -- > Better --help|less than helpless > > Den ons 12 aug. 2020 02:27John MacFarlane skrev: > >> Anton Shepelev writes: >> >> > John MacFarlane to Anton Shepelev: >> > >> >> > The documentation to walk_block() and walk_fil- >> >> > ter() states that the second parameter is "a Lua >> >> > filter (table of functions) to be applied within >> >> > the block element". >> >> > [...] >> >> > Is the documentation incorrect or do I misinter- >> >> > pret it? For aught I know, {Span = OnSpan} is >> >> > not a "table of functions". >> >> >> >> { } makes a table. OnSpan is a function. So, a >> >> table of functions. >> > >> > Please, bear with me. A table in Lua is the one-to- >> > rule-them-all complex type, that can represent many >> > sturctures, including array, associative array, or >> > structure. On the other hand, the generally used >> > meaning of `table' in programming and mathematics is >> > a two-dimensional sturcture with columns and any >> > number of rows from zero up, which, too, can be rep- >> > resented as a table in Lua, although it would be a >> > compound one. >> >> I would have thought that in the context of documenting a Lua >> function 'table' would be naturally interpreted as 'Lua table'. >> >> > But since the parameter is described as "a Lua fil- >> > ter" and "a table of functions", the only way to in- >> > terpret it is as describing the structure of the Lua >> > filter itself, which is a table of functions in both >> > Lua and general terminology: >> > >> > { { Id1 = Func1 } >> > { Id2 = Func2 } >> > { Id3 = Func3 } } >> >> According to the docs, "Lua filters are tables with element names >> as keys and values consisting of functions acting on those >> elements." So yes, the parameter to walk_block is a Lua filter as >> defined in the documentation. >> >> If you had >> >> { { Id1 = Funct1, >> Id2 = Funct2 } } >> >> that would be an array of Lua filters. But now, I see where you >> may be getting confused. Reading on in the docs: "Pandoc expects >> each Lua file to return a list of filters. The filters in that >> list are called sequentially, each on the result of the previous >> filter." It may be confusing that one often uses the term >> "lua filter" for the file itself. But the file can return >> a list (technically an array, implemented as a Lua table) of >> filters. I suspect you are confusing an array of Lua filters -- >> which can be defined in a single Lua file -- with a Lua filter. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/pandoc-discuss/m2o8nghfs7.fsf%40johnmacfarlane.net >> . >> > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhDhPnbCr-_qyb%3Dn3odtCneVnhsgPHo1wJXXm1nOuF%3DSsg%40mail.gmail.com. --0000000000009bee9b05aca9e27a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I wrote:

>= ;=C2=A0why it is useful that a filter script can return an array of filters= =C2=A0

That should obvio= usly have been "must return"! Sorry for any confusion!

--
Better --help|less= than helpless

Den ons 12 aug. 2020 10:19BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
I suppose that it might be worth poin= ting out that the reason why it is useful that a filter script can return a= n array of filters is explained here:


A note = on terminology: Since "table" on its own is rather ambiguous in L= ua=C2=A0may be a good idea=C2= =A0to clarify what kind of data a=C2= =A0it given table is supposed to contain by using= =C2=A0the terms "array table" and "map table" and possi= bly "mixed table" for a table with both array and map data, which= are sometimes convenient in Lua code, e.g. to tag an array.

--
B= etter --help|less than helpless

Den ons 12 aug. 2020 02:27John M= acFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> skrev:
Anton Shepelev <anton.txt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:=

> John MacFarlane to Anton Shepelev:
>
>> > The=C2=A0 documentation to walk_block() and walk_fil-
>> > ter() states that the second parameter is "a Lua
>> > filter (table of functions) to be applied within
>> > the block element".
>> > [...]
>> > Is the documentation incorrect or do I misinter-
>> > pret=C2=A0 it?=C2=A0 For=C2=A0 aught I know, {Span =3D OnSpan= } is
>> > not a "table of functions".
>>
>> { } makes a table.=C2=A0 OnSpan is a function.=C2=A0 =C2=A0So,=C2= =A0 a
>> table of functions.
>
> Please,=C2=A0 bear with me. A table in Lua is the one-to-
> rule-them-all complex type, that can represent=C2=A0 many
> sturctures,=C2=A0 including=C2=A0 array, associative array, or
> structure.=C2=A0 On the other hand,=C2=A0 the=C2=A0 generally=C2=A0 us= ed
> meaning of `table' in programming and mathematics is
> a two-dimensional sturcture=C2=A0 with=C2=A0 columns=C2=A0 and=C2=A0 a= ny
> number of rows from zero up, which, too, can be rep-
> resented as a table in Lua, although it would=C2=A0 be=C2=A0 a
> compound one.

I would have thought that in the context of documenting a Lua
function 'table' would be naturally interpreted as 'Lua table&#= 39;.

> But=C2=A0 since the parameter is described as "a Lua fil-
> ter" and "a table of functions", the only way to in- > terpret it is as describing the structure of the Lua
> filter itself, which is a table of functions in both
> Lua and general terminology:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ { Id1 = =3D Func1 }
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ = Id2 =3D Func2 }
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ = Id3 =3D Func3 } }

According to the docs, "Lua filters are tables with element names
as keys and values consisting of functions acting on those
elements." So yes, the parameter to walk_block is a Lua filter as
defined in the documentation.

If you had

=C2=A0 { { Id1 =3D Funct1,
=C2=A0 =C2=A0 =C2=A0 Id2 =3D Funct2 } }

that would be an array of Lua filters. But now, I see where you
may be getting confused. Reading on in the docs: "Pandoc expects
each Lua file to return a list of filters. The filters in that
list are called sequentially, each on the result of the previous
filter." It may be confusing that one often uses the term
"lua filter" for the file itself. But the file can return
a list (technically an array, implemented as a Lua table) of
filters.=C2=A0 I suspect you are confusing an array of Lua filters --
which can be defined in a single Lua file -- with a Lua filter.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe@go= oglegroups.com.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/m2o8nghfs7.fsf%40johnmacfarlane.net.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://gro= ups.google.com/d/msgid/pandoc-discuss/CADAJKhDhPnbCr-_qyb%3Dn3odtCneVnhsgPH= o1wJXXm1nOuF%3DSsg%40mail.gmail.com.
--0000000000009bee9b05aca9e27a--