From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31612 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "'William Lupton' via pandoc-discuss" Newsgroups: gmane.text.pandoc Subject: Re: Examples for some pandoc.List methods Date: Thu, 20 Oct 2022 18:10:04 +0100 Message-ID: References: <878rlao2x9.fsf@zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001f657905eb7a66d8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6477"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBBA4CY2NAMGQEPQ6Y5FI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Oct 20 19:10:32 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pl1-f186.google.com ([209.85.214.186]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1olZ3v-0001Us-RN for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 20 Oct 2022 19:10:31 +0200 Original-Received: by mail-pl1-f186.google.com with SMTP id z5-20020a170903018500b00184aedd9c75sf14380218plg.11 for ; Thu, 20 Oct 2022 10:10:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666285830; cv=pass; d=google.com; s=arc-20160816; b=Y9DzJFDYnP4B6932NitnfoaTOnj8l5mBMUd6DlxsCa7TR6G2yz+W9xweNHq8a7XyH3 PvHxdjkxWAuK+DrmFxi0Rzea/9Vl8N1bBSTq2AfgNfOXgaR6IsIb60hJK7QTFUM4x66O byWCs2654zNkw1XWqgZ+PsCoN7otwWiVedmtfmLaV9sKBm3pNb+Y0lYYSSdzv0wR+JLA ni76XtoL5e2iI/q/6sc0LyqvAV2JvgNwypCcdYEFAOYodaNThbr8ssMADDW0+tKYOgqs GM5IyXDYmDZgRlEk3Yetho2gji+VrHzRpbyt7noMY8ihjWfBEx0MsFAMYCoqSeHduarH qspw== 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:dkim-signature; bh=ifNAfT9xDTabWBSXGX8rHbhhmAPRgMNezIYi9xeQtao=; b=PAzr7s2A1TsByhYQmZGJooU8h4J8m1TciIqbj5KryA4WKO+ZCMKF++j8m4Ttj3zU8g VJUAP51VU1nn9kE87Jjzak52j52Gvrl/TPizQauQHxP+rCqfFNbEOac7JMr7Q4NLvSyg 298njRGpvrtVVBFyXJDFICJsTJnQBP/x9xCpiISmRAj6XT1fqTCMPlfozvEGtBqgxhan XcREitcS8nTI0Y1r+yzlwLhaWJeRK7AjxrsGRfYli3bSLy/LlRoAeZ531s7kORAF4TtV 0N2lFnSL2JQEnI3lMkM6rmS8G8V/0l+Z/bMNp/5Pv3bVX8VKT+8yUSEWa2uL3S8ubO43 Fg6Q== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=FZ9YuNJD; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::b2e as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:from:to:cc :subject:date:message-id:reply-to; bh=ifNAfT9xDTabWBSXGX8rHbhhmAPRgMNezIYi9xeQtao=; b=CxaTTRvUwDRcN0ljZVyYEIrKuxvgpeGRkuDLOKp7D3T3V7De2l0WCvO51IY8XwNhbe 1mP2wqn4gi/L90dsac7YqxVpgHrF8SXV7qo0BjutoJoPjKJUjMn+BoUutmWn7AtkgcGG /kAiL5vj1EizEq9UJqfp/5NM1gUQs19vAC6yf1o16JrckdyINv9k+tZDEBbUJkVHsjcz pKdSpSS6nyQW+oVP/AK/sSnvSdSzj2/rjiNC/LpIgocYfTEal9l/txoOpAdcyRWjE15t a8evwSQ9ZR/X4/ej5g2iiBbSCfopp8M85VLa6XGqAyqhGwBi4b9PFKF81MCcZPZmyb9f Lp+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ifNAfT9xDTabWBSXGX8rHbhhmAPRgMNezIYi9xeQtao=; b=bPOJ56zMW1/styusuQRcghhAAmqYxr63ej/j7OT57UIqSwnCTw1An152o/7rFaDwjT tk+DAjArnJfF8vEugwu0NmWSyrDuT5iEZrf9NfeiAiCkcZ1jtawDxxnX6tbWUnpHO2Qy OUvMN6jkdnq1p2ZxcWaU0Tv4ZQ0AM6mPvotk8F3ZImS/WPIzOtqTZ3+UuJtxb2fKOlx8 QCwxZsvWgv9L9WwanJQG/eRr8c4z8qNpmAjfHUJXCA62Uh6hQeq7GSAlGBiqIjwnSydy bGX2nv44qnNybAy5CEIItR/F3pgGxRdVtV78VZ1+w6hMlJLdYD8AFEgxu/soyVs X-Gm-Message-State: ACrzQf3sSIRPEd60pmuL5OkW1bnySL3h4c+WTFrsu88tmdZ5Qzs5KSZt T3G4g0oEUUHeRMsg+VUOAEs= X-Google-Smtp-Source: AMsMyM5mLIyX2D8n5W7VpWqS5tcKgqVu+2Zd9rcmRGtEEC07I6pytsVMSyJyinvTZgcC3AjxFOllyQ== X-Received: by 2002:a17:902:b907:b0:178:9d11:c978 with SMTP id bf7-20020a170902b90700b001789d11c978mr14989280plb.90.1666285830375; Thu, 20 Oct 2022 10:10:30 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:902:f355:b0:178:35a3:84d9 with SMTP id q21-20020a170902f35500b0017835a384d9ls97637ple.10.-pod-prod-gmail; Thu, 20 Oct 2022 10:10:27 -0700 (PDT) X-Received: by 2002:a17:902:9684:b0:17e:71b2:bd16 with SMTP id n4-20020a170902968400b0017e71b2bd16mr14880503plp.163.1666285816600; Thu, 20 Oct 2022 10:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666285816; cv=none; d=google.com; s=arc-20160816; b=MT1wTp+kdOrmTjr2xRgyt2YNb0fmzxYT4BNhYvyFVItpm0z6LdTFjaO12LkF36qmmJ /QDKWPhmXGjmqDleIyMKfmmix+xfPFbYMy+t345/4nj1yB1W8GNWI69JaXAmWD5xjcir Vsxhww3UV30F7XEAWE1vvVfoCsViappVmSITotfDJXXpa6OgnPO7nYFlbt1iGYG/eicr vsESKYfKQwuti+MD4t6DKCQOPopp2EcPX2cOKLM5ch4RQVaOMLzP8b6Q1tz+ln4PrJxD 1gFbP4rrR/17HKVnT1K0wJAtnf5o/Hx777+QJdVY7oaGb/CcIjeYqy95bfOGetnAdeWa tVrQ== 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=063aOJp90J03diEP/pGhVduQcbqs4CFGyZMJL0/JBWQ=; b=hRd4kkq2u5ecGTBd8ueClNVcVkN9WZTG+u8oKN4mOh6rOOet8Xwm4RxfyVZBkSzL86 G5X9S1gRUI4P+IPzfC7sexJ2HTD84DZ4xB3DT/q+qWotVxqqpVWYTS2B0K1AXpUP5IPG Brh+byEGS7fWafKSD08wHY1U7X6m3kJVrgB7jG9AFtCNwbKXcePfdIgtRlD4zJEsUEqz duPNnCcYPNdXVJSvrG7r4P9nj1yDUzfkh3fyEuPpksdIz3D80rUeLlz0A6a9f8MkKA0Q 9+OzsDUPKYlNAExbOvwF/ZBW/imPr17hAMqSv+7hyJnLyeC8xYQVQkYICvuB5gymkRre MUcA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=FZ9YuNJD; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::b2e as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org Original-Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com. [2607:f8b0:4864:20::b2e]) by gmr-mx.google.com with ESMTPS id k132-20020a62848a000000b0056611e6228dsi836750pfd.1.2022.10.20.10.10.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Oct 2022 10:10:16 -0700 (PDT) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::b2e as permitted sender) client-ip=2607:f8b0:4864:20::b2e; Original-Received: by mail-yb1-xb2e.google.com with SMTP id f205so369313yba.2 for ; Thu, 20 Oct 2022 10:10:16 -0700 (PDT) X-Received: by 2002:a25:9983:0:b0:6bc:71fb:75fe with SMTP id p3-20020a259983000000b006bc71fb75femr12493569ybo.393.1666285815417; Thu, 20 Oct 2022 10:10:15 -0700 (PDT) In-Reply-To: <878rlao2x9.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> X-Original-Sender: wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=FZ9YuNJD; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::b2e as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org X-Original-From: William Lupton 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:31612 Archived-At: --0000000000001f657905eb7a66d8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Also, 'needle' presumably refers to finding a needle in a haystack ( https://dictionary.cambridge.org/dictionary/english/needle-in-a-haystack), where the list is the haystack! The use of this term is probably paying homage to the C run-time library's strstr() function (and friends): STRSTR(3) Library Functions Manual STRSTR(3) NAME strstr, strcasestr, strnstr =E2=80=93 locate a substring in a string LIBRARY Standard C Library (libc, -lc) SYNOPSIS #include char *strstr(const char *haystack, const char *needle); ... DESCRIPTION The strstr() function locates the first occurrence of the null-terminated string needle in the null-terminated string haystack. On Thu, 20 Oct 2022 at 17:50, Albert Krewinkel wrote: > > perro tuerto writes: > > > Hi, I am trying to understand how to implement pandoc.List:find, > > pandoc.List:find_if, pandoc.List:filter and pandoc.List:includes but > > I don't understand what does =E2=80=9Cneedle=E2=80=9C or =E2=80=9Cpred= =E2=80=9D mean. Can I see some > > examples of how to use these methods? Thanks > > You are right, some examples would help to improve the docs. > > The test suite for lists contains some code that might help here: > https://github.com/hslua/hslua/blob/main/hslua-list/test/test-list.lua > E.g., for `find` see lines 79 ff. > > -- > Albert Krewinkel > GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 > > -- > 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/878rlao2x9.fsf%40zeitkra= ut.de > . > --=20 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 e= mail 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/CAEe_xxgZQvkNRsOD5JTTumPgWFKQPJNfitDAGM-mPLGVg6FSUg%40mail.g= mail.com. --0000000000001f657905eb7a66d8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Also, 'needle' presumably refers to finding a need= le in a haystack (https://dictionary.cambridge.org/dictionary/eng= lish/needle-in-a-haystack), where the list is the haystack!

The use of this term is probably paying homage to the C run-time li= brary's=C2=A0strstr() function (and friends):

= STRSTR(3) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Library Functions Manual =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 STRSTR(3= )

NAME
=C2=A0 =C2=A0 =C2=A0strstr, strcasestr, strnstr =E2=80=93 = locate a substring in a string

LIBRARY
=C2=A0 =C2=A0 =C2=A0Standa= rd C=C2=A0Library (libc, -lc)

SYNOPSIS
=C2=A0 =C2=A0 =C2=A0#inclu= de <string.h>
=C2=A0 =C2=A0 =C2=A0char *strstr(const char *haystac= k, const char *needle);
...

DESCRIPTION
=C2=A0 =C2=A0 =C2=A0The strstr() function locates t= he first occurrence of the null-terminated string needle in the null-termin= ated string
=C2=A0 =C2=A0 =C2=A0haystack.


On Thu, 20 Oct= 2022 at 17:50, Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> wrote:

perro tuerto <nika.zhenya-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hi, I am trying to understand how to implement pandoc.List:find,
> pandoc.List:find_if, pandoc.List:filter and pandoc.List:includes but > I don't understand what does =E2=80=9Cneedle=E2=80=9C or =E2=80=9C= pred=E2=80=9D mean. Can I see some
> examples of how to use these methods? Thanks

You are right, some examples would help to improve the docs.

The test suite for lists contains some code that might help here:
https://github.com/hslua/hslua= /blob/main/hslua-list/test/test-list.lua
E.g., for `find` see lines 79 ff.

--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe=C2=A0 e836 388d c0b2 1f63 1124

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/878rlao= 2x9.fsf%40zeitkraut.de.

--
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://groups.= google.com/d/msgid/pandoc-discuss/CAEe_xxgZQvkNRsOD5JTTumPgWFKQPJNfitDAGM-m= PLGVg6FSUg%40mail.gmail.com.
--0000000000001f657905eb7a66d8--