Received: from mail-qg0-f62.google.com ([209.85.192.62]:33776) by stodi.digitalkingdom.org with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.80.1) (envelope-from ) id 1YfX9V-0002xV-8G; Tue, 07 Apr 2015 10:19:09 -0700 Received: by qgdz60 with SMTP id z60sf12646594qgd.0; Tue, 07 Apr 2015 10:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe; bh=zQ5uKQameZkAzBiTg5hgyHT8Nf81fURqIPC6FMHuiZM=; b=efOPjFgpVVeyPosxmnW+4FCqZFooDdSeojvLNDB0X9QpcnSHlzLgs37pYnxS10+c5E Xgo2jvf6SxYEVNZPk11NMj7QLFg/u7GbhEvBHXCgsMOM+SZzmMebsYwzNhjHxaP7eEde A1x1WR0sHWrLuE4K/gAeZSeAehhnSOoUPHQNYdKIfBeE68z6vwCGjzxcIy2iLH3YsmhV z1wPAI8eFXdj3XdBkFBFMlZJ9l43/zi+N5xRVe9A49iKTKquBurzlYPl3xYVdPI8wWLQ j3bAyNIs1Ta21BCAlfNQHTHm1J97M6GWy7X2epMbeBl6jOJkguJbiBfjyIMrK7H8uljb mUHQ== X-Received: by 10.50.57.104 with SMTP id h8mr92597igq.15.1428427138933; Tue, 07 Apr 2015 10:18:58 -0700 (PDT) X-BeenThere: bpfk-list@googlegroups.com Received: by 10.50.239.165 with SMTP id vt5ls296485igc.25.gmail; Tue, 07 Apr 2015 10:18:58 -0700 (PDT) X-Received: by 10.50.122.7 with SMTP id lo7mr4099330igb.7.1428427138759; Tue, 07 Apr 2015 10:18:58 -0700 (PDT) Received: from mail-qg0-x234.google.com (mail-qg0-x234.google.com. [2607:f8b0:400d:c04::234]) by gmr-mx.google.com with ESMTPS id z4si1350106qcf.0.2015.04.07.10.18.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Apr 2015 10:18:58 -0700 (PDT) Received-SPF: pass (google.com: domain of durka42@gmail.com designates 2607:f8b0:400d:c04::234 as permitted sender) client-ip=2607:f8b0:400d:c04::234; Received: by mail-qg0-x234.google.com with SMTP id y78so23830012qgd.0 for ; Tue, 07 Apr 2015 10:18:58 -0700 (PDT) X-Received: by 10.140.101.214 with SMTP id u80mr23900390qge.48.1428427138571; Tue, 07 Apr 2015 10:18:58 -0700 (PDT) Received: from [2607:f470:6:400d:1400::] ([2607:f470:6:400d:49ff:ef41:d955:e902]) by mx.google.com with ESMTPSA id 135sm5751952qhq.23.2015.04.07.10.18.57 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 07 Apr 2015 10:18:57 -0700 (PDT) Date: Tue, 7 Apr 2015 13:18:56 -0400 From: Alex Burka To: bpfk-list@googlegroups.com Message-ID: <1A2E049F0CB84036907C6CAAE5923EE9@gmail.com> In-Reply-To: References: Subject: Re: [bpfk] One cannot refer to inner nodes in Lojban PEG X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="55241180_4244b8de_14c" X-Original-Sender: durka42@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of durka42@gmail.com designates 2607:f8b0:400d:c04::234 as permitted sender) smtp.mail=durka42@gmail.com; dkim=pass header.i=@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Reply-To: bpfk-list@googlegroups.com Precedence: list Mailing-list: list bpfk-list@googlegroups.com; contact bpfk-list+owners@googlegroups.com List-ID: X-Google-Group-Id: 972099695765 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Score: -1.6 (-) X-Spam_score: -1.6 X-Spam_score_int: -15 X-Spam_bar: - --55241180_4244b8de_14c Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline I guess I don't follow. If string_1 doesn't want to have all of the possible string_3 realizations inside, then why does it ask for string_3? In this example, just use string_1 = string_2 / string_6 string_8 instead. Can you make a more concrete example? What specific "actions" differ depending on whether a term contains FA or BAI? mu'o mi'e durkavore On Tuesday, April 7, 2015 at 4:28 AM, Gleki Arxokuna wrote: > Consider the following: > string_1 = string_2 / string_6 string_3 > string_3 = string_7 / string_8 > string_4 = !string_1 string_5 > > Now we need !string_1 to work only if string_8 matches, not when string_7 matches. > Why we might need that? E.g. for terms that can have either FA or BAI inside. Depending on whether we have FA or BAI inside a term our actions may differ. > > How can we implement that? > We can just create duplicates of two strings like this: > > string_1 = string_2 / string_6 string_3 > string_1_2 = string_2 / string_6 string_3_2 > string_3 = string_7 / string_8 > string_3_2 = string_8 > string_4 = !string_1_2 string_5 > > Now string_1_2 is the same as string_1 but it is matched only if string_8 matches (unlike string_1, otherwise they are the same). > > Now the question is how do we avoid such duplication? > > The answer from peg.js developers: > > Sorry, but there is currently no clean way to avoid the duplication. > > In the future I'm thinking about adding support for rule templates/parametrizable rules, which would help here: > > string_1 = string_2 / string_6 T > string_3 = string_7 / string_8 > string_3_2 = string_8 > string_4 = !string_1 string_5 > > And I think it'd be nice > > > So for now our only chance is to copy paster parts of Lojban PEG if we want such things. I.e. one would need to split terms into "terms_for_BAI", "terms_for_FA" etc. with all their inner variables copied. > > -- > You received this message because you are subscribed to the Google Groups "BPFK" group. > To unsubscribe from this group and stop receiving emails from it, send an email to bpfk-list+unsubscribe@googlegroups.com (mailto:bpfk-list+unsubscribe@googlegroups.com). > To post to this group, send email to bpfk-list@googlegroups.com (mailto:bpfk-list@googlegroups.com). > Visit this group at http://groups.google.com/group/bpfk-list. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "BPFK" group. To unsubscribe from this group and stop receiving emails from it, send an email to bpfk-list+unsubscribe@googlegroups.com. To post to this group, send email to bpfk-list@googlegroups.com. Visit this group at http://groups.google.com/group/bpfk-list. For more options, visit https://groups.google.com/d/optout. --55241180_4244b8de_14c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
I guess I don't follow. If string_1 doesn't want to hav= e all of the possible string_3 realizations inside, then why does it ask fo= r string_3? In this example, just use

string_1 =3D string_2 / string_6 = string_8

instead. Can you make a more concrete exa= mple? What specific "actions" differ depending on whether a term contains F= A or BAI?

mu'o mi'e durkavore
=20

On Tuesday, April 7, 2015 at 4= :28 AM, Gleki Arxokuna wrote:

Consider the foll= owing:
string_1 =3D string_2 / string_6 string_3
string= _3 =3D string_7 / string_8
string_4 =3D !string_1 string_5 <= /div>

Now we need !string_1 to work only if string_8 mat= ches, not when string_7 matches.
Why we might need that? E.g. for= terms that can have either FA or BAI inside. Depending on whether we have = FA or BAI inside a term our actions may differ.

Ho= w can we implement that?
We can just create duplicates of two str= ings like this:

string_1 =3D string_2 / string_6 s= tring_3
string_1_2 =3D string_2 / string_6 string_3_2
s= tring_3 =3D string_7 / string_8
string_3_2 =3D string_8
string_4 =3D !string_1_2 string_5 

Now strin= g_1_2 is the same as string_1 but it is matched only if string_8 matches (u= nlike string_1, otherwise they are the same).

Now = the question is how do we avoid such duplication?

= The answer from peg.js developers:
<quote>
Sorry,= but there is currently no clean way to avoid the duplication.
In the future I'm thinking about adding support for rule templ= ates/parametrizable rules, which would help here:

= string_1<T> =3D string_2 / string_6 T
string_3 =3D string_7= / string_8
string_3_2 =3D string_8
string_4 =3D !strin= g_1<string_3_2> string_5 

And I think i= t'd be nice 
</quote>

So = for now our only chance is to copy paster parts of Lojban PEG if we want su= ch things. I.e. one would need to split terms into "terms_for_BAI", "terms_= for_FA" etc. with all their inner variables copied.

--
You received this message because you are subscribed to the Google Groups "= BPFK" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to bpfk-list= +unsubscribe@googlegroups.com.
To post to this group, send email to bpfk-list@googlegroups.com.
Visit this group at ht= tp://groups.google.com/group/bpfk-list.
For more options, visit http= s://groups.google.com/d/optout.
=20 =20 =20 =20
=20

=20

--
You received this message because you are subscribed to the Google Groups &= quot;BPFK" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to bpfk-list= +unsubscribe@googlegroups.com.
To post to this group, send email to bpfk-list@googlegroups.com.
Visit this group at ht= tp://groups.google.com/group/bpfk-list.
For more options, visit http= s://groups.google.com/d/optout.
--55241180_4244b8de_14c--