From bduggan at matatu.org Thu Apr 4 05:42:55 2019 From: bduggan at matatu.org (Brian Duggan) Date: Thu, 4 Apr 2019 08:42:55 -0400 Subject: [Philadelphia-pm] April 10: Perl 6 Clinic Message-ID: <20190404124255.GA61854@Brian-C02WV0VKHTDD> Hi Folks, For our next meeting -- April 10th at 6pm -- John Karr has offered to facilitate a Perl 6 Clinic: When: April 10, 6pm Where: Industrious -- 230 S Broad st, 18th floor (enter on Locust) What: Bring your laptop to the Perl 6 clinic. Show off your embarrassing I'm learning Perl 6 code, so we can all have a good laugh. No seriously show your bad code so we can all learn from it. Some of our Philadelphia PerlMongers already used Perl 6 a lot, others of us are just getting started. See everybody soon! Brian From bduggan at matatu.org Thu Apr 11 06:12:25 2019 From: bduggan at matatu.org (Brian Duggan) Date: Thu, 11 Apr 2019 09:12:25 -0400 Subject: [Philadelphia-pm] syms in grammars Message-ID: <20190411131225.GA32922@Brian-C02WV0VKHTDD> Hi Folks, Thanks to those who came yesterday for the clinic :-) Following up on the conversation from dinner -- here's an example of using syms to simplify alternation -- Before: grammar g { rule TOP { 1 2 } token op { | } token x { x } token y { y | Y } } class a { method op($/) { say "op is " ~ ( $ // $ ) # we want to avoid this } } After: grammar g { rule TOP { 1 2 } proto token op { <...> } token op:sym { x } token op:sym { y | Y } } class a { method op:sym ($/) { say 'op is x'; } method op:sym ($/) { say 'op is y or Y'; } } my $actions = a.new; say g.parse('1 x 2', :$actions); say '---'; say g.parse('1 y 2', :$actions); say '---'; say g.parse('1 Y 2', :$actions); which produces op is x ?1 x 2? op => ?x? --- op is y or Y ?1 y 2? op => ?y? --- op is y or Y ?1 Y 2? op => ?Y? From perl.phl at rjbs.manxome.org Sun Apr 14 18:35:22 2019 From: perl.phl at rjbs.manxome.org (Ricardo Signes) Date: Sun, 14 Apr 2019 21:35:22 -0400 Subject: [Philadelphia-pm] syms in grammars In-Reply-To: <20190411131225.GA32922@Brian-C02WV0VKHTDD> References: <20190411131225.GA32922@Brian-C02WV0VKHTDD> Message-ID: <20190415013522.GA5837@debian> * Brian Duggan [2019-04-11T09:12:25] > Thanks to those who came yesterday for the clinic :-) Thank you! For those who did not attend, the majority of the meeting time was spent with Curt and Brian helping me build a grammar so that my (barely-written) ZMachine story file generator could be tied to a (brand new) grammar for an assembly language. The product was more or less this commit: https://github.com/rjbs/ZMachine-Whiz/commit/fcdad8c33cbb46a1aa7bdc4a55fc07a2518d456f ...and if you follow that along, you can see why Brian might be posting this message. I was a bit overwhelmed at being Johnny on the Spot for the whole evening, but it was a good time, and I definitely learned a fair bit. -- rjbs -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: Digital signature URL: From curt at tilmes.org Tue Apr 16 04:54:16 2019 From: curt at tilmes.org (Curt Tilmes) Date: Tue, 16 Apr 2019 07:54:16 -0400 Subject: [Philadelphia-pm] syms in grammars In-Reply-To: <20190415013522.GA5837@debian> References: <20190411131225.GA32922@Brian-C02WV0VKHTDD> <20190415013522.GA5837@debian> Message-ID: On Sun, Apr 14, 2019 at 9:35 PM Ricardo Signes wrote: > For those who did not attend, the majority of the meeting time was spent > with > Curt and Brian helping me build a grammar so that my (barely-written) > ZMachine > story file generator could be tied to a (brand new) grammar for an assembly > language. > It was a lot of fun -- I learned some new tricks. We should try to get it to the point it will read the old files here: https://github.com/historicalsource Curt -------------- next part -------------- An HTML attachment was scrubbed... URL: From perl.phl at rjbs.manxome.org Tue Apr 16 06:39:36 2019 From: perl.phl at rjbs.manxome.org (Ricardo Signes) Date: Tue, 16 Apr 2019 09:39:36 -0400 Subject: [Philadelphia-pm] syms in grammars In-Reply-To: References: <20190411131225.GA32922@Brian-C02WV0VKHTDD> <20190415013522.GA5837@debian> Message-ID: <20190416133936.GB15121@debian> * Curt Tilmes [2019-04-16T07:54:16] > We should try to get it to the point it will read the old files here: > > https://github.com/historicalsource I cloned all of those just this morning. Those are mostly written in ZIL, a language I definitely do not want to implement. It's somewhat Lisp-like, being based on MDL. Here's some ZIL: From https://github.com/historicalsource/suspended/blob/master/robots.zil > )> >> > > ,ROOMS> .L) (T )>> > > > )>)> Yow. What I was working on was more like zasm, which was prefigured by XZAP, the original Z-machine assembler, seen here: .FUNCT THIS-IT?,OBJ,TBL,SYNS,?TMP1 FSET? OBJ,INVISIBLE /FALSE ZERO? P-NAM /?THN3 GETPT OBJ,P?SYNONYM >SYNS PTSIZE SYNS DIV STACK,2 SUB STACK,1 CALL ZMEMQ,P-NAM,SYNS,STACK ZERO? STACK /FALSE ?THN3: ZERO? P-ADJ /?ELS8 GETPT OBJ,P?ADJECTIVE >SYNS ZERO? SYNS /FALSE PTSIZE SYNS SUB STACK,1 CALL ZMEMQB,P-ADJ,SYNS,STACK ZERO? STACK /FALSE ?ELS8: ZERO? P-GWIMBIT /TRUE FSET? OBJ,P-GWIMBIT /TRUE RFALSE .ENDI Obviously better, right? -- rjbs -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: Digital signature URL: From bduggan at matatu.org Tue Apr 16 07:12:02 2019 From: bduggan at matatu.org (Brian Duggan) Date: Tue, 16 Apr 2019 10:12:02 -0400 Subject: [Philadelphia-pm] syms in grammars In-Reply-To: <20190416133936.GB15121@debian> References: <20190411131225.GA32922@Brian-C02WV0VKHTDD> <20190415013522.GA5837@debian> <20190416133936.GB15121@debian> Message-ID: <20190416141202.GA1630@Brian-C02WV0VKHTDD> On Tuesday, April 16, Ricardo Signes wrote: > Obviously better, right? :-) I don't know...but that comment made me wonder if someone had already done a Lisp grammar and sure enough -- this is kind of cool: https://examples.perl6.org/categories/interpreters/lisp.html Brian