clojure is supposed to be 'code is data' yet I can't add to the end of a list?

2021-07-17 Thread SideStep



I have a representation of a matrix in grid.clj file:

(-> (grid 10 10)
(toggle 2 3 4 5)
(off 2 3 4 5)
(on 2 3 4 5))

It's a list of functionts, first one initializes a grid, others modify it.
Clojures' 'code is data' supposed to make it easy for me to modify that 
representation by adding an instrucion at the *end* of collection. List is 
an ordered collection right? Order matters. How do I add an instruction to 
the end of the list then?
Something like this:

(def grid (read-string (slurp "grid.clj")))
(conj grid '(off 1 2 3 6))

Yet I can't add to the end of the list, which is a data structure that is 
evaluatable as code. How is it 'code as data' if I can't add to the end of 
the ordered collection that is meant for code (as data)?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/efd72013-a85e-46e8-b9db-10dde1a8a235n%40googlegroups.com.


lochdown - will be the new operating system

2021-07-17 Thread Sergei Udris
couldn't rename Trash dir on Ubuntu - it's even part of xdg spec, so new OS 
is needed

repo is https://github.com/cljctools/lochdown

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/e4855ba6-134f-401d-9b18-daf9930cc4e5n%40googlegroups.com.


ClassNotFoundException when importing a clojure interface

2021-07-17 Thread Jack Park
I created a gist
https://gist.github.com/KnowledgeGarden/39742ae9ae641f0d8facb31b288ece4c

which explains a ClassNotFoundException when I am importing and reifying a 
particular interface in another clj file.

It's really baffling because, in the load order, core calls a test in a 
test file - getting that to compile landed on the solution of an (:import 
...) statement; once that worked, then the code in that test calls another 
file AndList.clj which happens to have several places where it reifies the 
same interface. Except, with the same import statement, on that file, I get 
the error.  Difficult to even find a decent StackOverflow because one such 
StackOverflow appears to be very similar, and the suggested fix is what I 
have now.

Thanks in advance for ideas.
Jack

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/ffb09a94-5aa4-4600-8c9a-e0d00901df72n%40googlegroups.com.


Re: clojure is supposed to be 'code is data' yet I can't add to the end of a list?

2021-07-17 Thread Tanya Moldovan
Hi,

conj  adds at the end of a
vector, but at the beginning of a list. It is how it is implemented. I
think this

and
this  sums
it up why.

You could achieve what you want by using concat
 (note this returns a LazySeq):

user=> (concat grid '((off 1 2 3 6)))
(-> (grid 10 10) (toggle 2 3 4 5) (off 2 3 4 5) (on 2 3 4 5) (off 1 2 3 6))

Though I'm not exactly sure what is the end goal of this but I'd rethink
the way it is done.



On Sat, 17 Jul 2021 at 14:24, SideStep  wrote:

>
> 
>
> I have a representation of a matrix in grid.clj file:
>
> (-> (grid 10 10)
> (toggle 2 3 4 5)
> (off 2 3 4 5)
> (on 2 3 4 5))
>
> It's a list of functionts, first one initializes a grid, others modify it.
> Clojures' 'code is data' supposed to make it easy for me to modify that
> representation by adding an instrucion at the *end* of collection. List
> is an ordered collection right? Order matters. How do I add an instruction
> to the end of the list then?
> Something like this:
>
> (def grid (read-string (slurp "grid.clj")))
> (conj grid '(off 1 2 3 6))
>
> Yet I can't add to the end of the list, which is a data structure that is
> evaluatable as code. How is it 'code as data' if I can't add to the end of
> the ordered collection that is meant for code (as data)?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clojure/efd72013-a85e-46e8-b9db-10dde1a8a235n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CADBYUPvzMtspZxxc5PhmkXyNg7kJqgMG%3DWVkUe2FKsf%2BGsdaFA%40mail.gmail.com.


Parse an EBNF grammar with instaparse?

2021-07-17 Thread Jakob Schöttl

Hi all,

I was hoping that I can call

(instaparse.core/parser "my ::= 'ebnf' | 'grammar' ")

to get a parse tree of the EBNF. I'd like to convert the EBNF to a 
tree-sitter grammar.js.

But when I evaluate the above expression, I only see a the original EBNF 
input, reformatted, and without comments:

=> my = "ebnf" | "grammar"

Is there a way to get hands on the underlying structure, i.e. the parse 
tree?

Best, Jakob

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/59ca6c3a-c342-4e32-8f19-044ec1ce0de9n%40googlegroups.com.


Reporting Potential Security Vulnerabilities in the Clojure Codebase

2021-07-17 Thread William Blair

Does the Clojure project have a protocol in place for reporting potential 
security vulnerabilities found in the runtime? I'd be happy to share a 
proof of concept I have so that the developers can assess whether or not 
what I've found is a true vulnerability. 

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/33782b2b-392a-46e3-b360-fdbb0967c3ean%40googlegroups.com.


Re: [ANN] Discontinuing 4clojure.com

2021-07-17 Thread Peter Strömberg
I don't know which groups are competing, but I can vouch for the 4ever
constellation. Not only are they highly trustworthy, but also known for
getting shit done, and as stayers.

On Wed, 14 Jul 2021 at 08:50, Alan Malloy  wrote:

> There have been a number of requests on this thread for me to transfer the
> 4clojure.com domain name to a designated successor. I'm open to that in
> principle, but there are a couple issues.
>
>1. I don't actually own the 4clojure.com domain name. That belongs to
>4clojure's founder, dbyrne, who has been renewing it and pointing it at my
>server. I imagine he will be happy to transfer it, but there might be
>organizational hiccups I'm not aware of. If a successor is chosen, we can
>loop him in then.
>2. I wouldn't want to transfer the domain to someone who turns out to
>be unable to use it - maybe setting up a copy of 4clojure is harder than
>one might imagine, since it's all 10-year-old technology. If any of the
>prospective new owners already have a copy of 4clojure running under a
>different domain name, I'd love to see it. Of course, the 4ever-clojure
>guys have already done this.
>3. This is more of a "me" problem because my interaction with the
>Clojure community for years has just been the tiny IRC room and Stack
>Overflow, but so far all the offers to take on the mantle have come from
>people and companies I've never heard of. Maybe you're all pillars of the
>community now, but I just don't know it. I'd hate to give the name over to
>a group planning to do something nefarious with collected email addresses,
>for example. I feel like kinda a jerk for asking, since it's not like I was
>the greatest maintainer, but I don't suppose there are any old-time
>Clojurists who can vouch for any of these groups? Feel free to email me
>privately (amalloy@ the domain in question, for now!) if you'd prefer
>not to be on record as favoring one of these groups over the others.
>
>
> On Monday, July 12, 2021 at 9:13:09 PM UTC-7 brando...@gmail.com wrote:
>
>> Thank you Alan for all the work and time put into 4clojure, and thank
>> those of you who've started and contributed to 4ever-clojure!
>>
>> Cheers,
>> Brandon
>>
>> On Sun, Jul 11, 2021 at 2:38 PM Alan Malloy  wrote:
>>
>>> I've also exported the problem data:
>>> https://drive.google.com/file/d/1hHrygxAs5Do8FpHC9kphYnmyTwZvISnb/view?usp=sharing
>>> .
>>>
>>> On Sunday, July 11, 2021 at 2:22:33 PM UTC-7 Alan Malloy wrote:
>>>
 I'm happy to see this project, and I think exporting some data is a
 reasonable compromise. Rather than re-learn how to do any fancy mongodb
 stuff to make it into "pretty" json, I've just done a raw JSON export of
 the solutions collection, which is world-readable at
 https://drive.google.com/file/d/1UQHznThT_eVTBjmLGz3yME8L3teGygUs/view?usp=sharing.
 I'm contemplating doing a partial export of the users collection too: I
 could connect usernames to IDs without including the email addresses or
 passwords, which would let you rebuild most of the user information. But
 I'm not totally sure this is a good idea: some people may not want their
 usernames shared, or associated with their solutions. Does anyone in this
 thread have an opinion?

 On Tuesday, July 6, 2021 at 9:58:29 AM UTC-7 oxa...@gmail.com wrote:

> Thank you Alan for all your contributions :)
>
> Hosting things and maintaing them is really hard. We, the LambdaIsland
> team, are already maintaining clojurians-log and clojureverse and it's
> definitely not easy!
>
> With a wonderful idea from @borkdude and his `sci` library, I built
> "4ever-clojure": a completely static version of 4clojure which runs using
> cljs + sci. It interprets the code in the browser itself.
>
> It's live at: 4clojure.oxal.org  (Source code at:
> https://github.com/oxalorg/4ever-clojure  I'm planning to move it
> under the clojureverse github org)
>
> I have 2 asks from you if it is feasible:
> 1. An export of all solutions (only solutions, no user data needed) -
> the community is already coming up with some amazing ideas of hooking up
> user solutions to automatically commit to a Github repo
> 2. Possibility of transfering *4clojure.com  *-or-
> *4clojure.org  *over to us so that we can host
> 4ever-clojure there (instead of on a separate domain)
>
> Thanks!
> - Mitesh
>
> On Tuesday, July 6, 2021 at 5:56:10 PM UTC+5:30 Srihari Sriraman wrote:
>
>> Hey Alan, we really like 4clojure. We've suggested using it for
>> training most people at nilenso and we're very thankful to you and all 
>> the
>> contributors for that!
>> We (nilenso) would be up for picking up the hosting costs, and also
>> some other operations or development work if needed.
>>
>> It w

Re: [ANN] Discontinuing 4clojure.com

2021-07-17 Thread Peter Strömberg
Thanks, thanks, thanks, for creating and caring about 4clojure for this
long, Alan! I can't tell how instrumental it has been on my Clojure
journey. Not only for learning the language, also for keeping it fun there
in the beginning when I doubted I could learn enough of it to get
productive. I'm not sure I would have been a Clojurian today if it wasn't
for 4clojure.

Best regards,
/Peter

Den sön 11 juli 2021 kl 23:38 skrev Alan Malloy :

> I've also exported the problem data:
> https://drive.google.com/file/d/1hHrygxAs5Do8FpHC9kphYnmyTwZvISnb/view?usp=sharing
> .
>
> On Sunday, July 11, 2021 at 2:22:33 PM UTC-7 Alan Malloy wrote:
>
>> I'm happy to see this project, and I think exporting some data is a
>> reasonable compromise. Rather than re-learn how to do any fancy mongodb
>> stuff to make it into "pretty" json, I've just done a raw JSON export of
>> the solutions collection, which is world-readable at
>> https://drive.google.com/file/d/1UQHznThT_eVTBjmLGz3yME8L3teGygUs/view?usp=sharing.
>> I'm contemplating doing a partial export of the users collection too: I
>> could connect usernames to IDs without including the email addresses or
>> passwords, which would let you rebuild most of the user information. But
>> I'm not totally sure this is a good idea: some people may not want their
>> usernames shared, or associated with their solutions. Does anyone in this
>> thread have an opinion?
>>
>> On Tuesday, July 6, 2021 at 9:58:29 AM UTC-7 oxa...@gmail.com wrote:
>>
>>> Thank you Alan for all your contributions :)
>>>
>>> Hosting things and maintaing them is really hard. We, the LambdaIsland
>>> team, are already maintaining clojurians-log and clojureverse and it's
>>> definitely not easy!
>>>
>>> With a wonderful idea from @borkdude and his `sci` library, I built
>>> "4ever-clojure": a completely static version of 4clojure which runs using
>>> cljs + sci. It interprets the code in the browser itself.
>>>
>>> It's live at: 4clojure.oxal.org  (Source code at:
>>> https://github.com/oxalorg/4ever-clojure  I'm planning to move it under
>>> the clojureverse github org)
>>>
>>> I have 2 asks from you if it is feasible:
>>> 1. An export of all solutions (only solutions, no user data needed) -
>>> the community is already coming up with some amazing ideas of hooking up
>>> user solutions to automatically commit to a Github repo
>>> 2. Possibility of transfering *4clojure.com  *-or- 
>>> *4clojure.org
>>>  *over to us so that we can host 4ever-clojure
>>> there (instead of on a separate domain)
>>>
>>> Thanks!
>>> - Mitesh
>>>
>>> On Tuesday, July 6, 2021 at 5:56:10 PM UTC+5:30 Srihari Sriraman wrote:
>>>
 Hey Alan, we really like 4clojure. We've suggested using it for
 training most people at nilenso and we're very thankful to you and all the
 contributors for that!
 We (nilenso) would be up for picking up the hosting costs, and also
 some other operations or development work if needed.

 It would be even better if we could work together and turn this into a
 community owned project (ex: clojurists together
 ). That might also assuage your
 concerns about data ownership.

 The questions, and solutions that the community has put together on
 4clojure over the last decade are very valuable as a learning tool. Perhaps
 we can find a way to keep them around without attributing them to a user?
 One idea might be to deactivate all existing accounts, and remove the user
 data (email, passwords, other PII) etc while keeping the questions and
 solutions from those users.

 We would be sad to see 4clojure go away, hope we can find a way for it
 to live on.

 Cheers,
 Srihari

 On Tuesday, July 6, 2021 at 1:12:44 PM UTC+5:30 Robert P. Levy wrote:

> Hi Alan,
>
> Just as a thought.  If it's minimal work on your end (eg. if the folks
> from Roam research who chimed in above pick it up) why not clear the
> password hashes and let the new maintainer handle the communication that
> passwords need to be reset?
>
> Rob
>
> On Sun, Jul 4, 2021 at 1:26 PM Alan Malloy  wrote:
>
>> TL;DR: Turning off 4clojure.com by the end of July 2021
>>
>> Hello, 4clojure problem solvers. You've probably noticed SSL errors
>> on 4clojure.com over the last week. The old decrepit system 4clojure
>> runs on has finally gotten out of date enough that I can't even figure 
>> out
>> how to get it recent enough that SSL certs will auto-renew anymore.
>>
>> In principle I could start from scratch on a new server and move
>> 4clojure over, but I won't. 4clojure has been piggybacking along on a
>> server that I use for personal reasons, and over the years I have less 
>> and
>> less reason to keep paying for that server - it's now pretty much just
>> 4clojure costing me an embarrassing a

Re: ClassNotFoundException when importing a clojure interface

2021-07-17 Thread Tanya Moldovan
Hi,

I don't think it is the right way to use interfaces in clojure. Take a look
at  this

 and this

.
You could create a java project with the interfaces you need and import
that instead.

I think the issue is that this setup requires AOT and it might be missing
from your configuration.
To fix it try adding this to project.clj file:

:profiles {:dev {:aot [ie4clj.api]}}

It can be tricky If you want to do lein uberjar and generate a jar file.

Alternatively, you can use compile-files
 (then you don't need
import statement).
(note that in your gist you had some errors when defining AndList, I've
fixed it)
(also take a look at the clojure style guide
, as AndList is not really
the way to name things in clojure )) )

(ns ie4clj.api)

(definterface Inferrable
  (^boolean eval [])
  (^boolean evalMembers [members]))

(ns ie4clj.AndList)

(when *compile-files*
  (require 'ie4clj.api))

(def AndList
  (reify
   ie4clj.api.Inferrable
   (eval [_] true)
   (evalMembers [_ m] true)))

Hope this helps,



On Sat, 17 Jul 2021 at 21:06, Jack Park  wrote:

> I created a gist
> https://gist.github.com/KnowledgeGarden/39742ae9ae641f0d8facb31b288ece4c
>
> which explains a ClassNotFoundException when I am importing and reifying a
> particular interface in another clj file.
>
> It's really baffling because, in the load order, core calls a test in a
> test file - getting that to compile landed on the solution of an (:import
> ...) statement; once that worked, then the code in that test calls another
> file AndList.clj which happens to have several places where it reifies the
> same interface. Except, with the same import statement, on that file, I get
> the error.  Difficult to even find a decent StackOverflow because one such
> StackOverflow appears to be very similar, and the suggested fix is what I
> have now.
>
> Thanks in advance for ideas.
> Jack
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clojure/ffb09a94-5aa4-4600-8c9a-e0d00901df72n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CADBYUPvwWc0UqGZ-WdgtvAmkzH0RZ34_0EbbLs3QshFC2%2B3BGw%40mail.gmail.com.


Re: ClassNotFoundException when importing a clojure interface

2021-07-17 Thread Jack Park
Tanya,

That did help, swapping  ie4clj.api.Inferrable for its import.
That, of course, got me into the next coding bug, about which I shall ask
next (I am attempting to use doseq to walk a list and AND its Inferrable
members)

Meanwhile, I am truly surprised that you said

I don't think it is the right way to use interfaces in clojure.
>
It's likely a result of dyslexia that I did not see that coming after
studying all the online banter about interfaces and protocols.. I chose
definterface because the examples showed how to specify the return values,
and programming by interface is how I do Java. I'd like to discover what,
precisely, to read and get past dyslexic events to learn how to use
interfaces.

Many thanks
Jack

On Sat, Jul 17, 2021 at 4:10 PM Tanya Moldovan 
wrote:

> Hi,
>
> I don't think it is the right way to use interfaces in clojure. Take a
> look at  this
> 
>  and this
> 
> .
> You could create a java project with the interfaces you need and import
> that instead.
>
> I think the issue is that this setup requires AOT and it might be missing
> from your configuration.
> To fix it try adding this to project.clj file:
>
> :profiles {:dev {:aot [ie4clj.api]}}
>
> It can be tricky If you want to do lein uberjar and generate a jar file.
>
> Alternatively, you can use compile-files
>  (then you don't
> need import statement).
> (note that in your gist you had some errors when defining AndList, I've
> fixed it)
> (also take a look at the clojure style guide
> , as AndList is not
> really the way to name things in clojure )) )
>
> (ns ie4clj.api)
>
> (definterface Inferrable
>   (^boolean eval [])
>   (^boolean evalMembers [members]))
>
> (ns ie4clj.AndList)
>
> (when *compile-files*
>   (require 'ie4clj.api))
>
> (def AndList
>   (reify
>ie4clj.api.Inferrable
>(eval [_] true)
>(evalMembers [_ m] true)))
>
> Hope this helps,
>
>
>
> On Sat, 17 Jul 2021 at 21:06, Jack Park  wrote:
>
>> I created a gist
>> https://gist.github.com/KnowledgeGarden/39742ae9ae641f0d8facb31b288ece4c
>>
>> which explains a ClassNotFoundException when I am importing and reifying
>> a particular interface in another clj file.
>>
>> It's really baffling because, in the load order, core calls a test in a
>> test file - getting that to compile landed on the solution of an (:import
>> ...) statement; once that worked, then the code in that test calls another
>> file AndList.clj which happens to have several places where it reifies the
>> same interface. Except, with the same import statement, on that file, I get
>> the error.  Difficult to even find a decent StackOverflow because one such
>> StackOverflow appears to be very similar, and the suggested fix is what I
>> have now.
>>
>> Thanks in advance for ideas.
>> Jack
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/clojure/ffb09a94-5aa4-4600-8c9a-e0d00901df72n%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clojure/CADBYUPvwWc0UqGZ-WdgtvAmkzH0RZ34_0EbbLs3QshFC2%2B3BGw%40mail.gmail.com
> 
> .
>

-- 
You

Re: Parse an EBNF grammar with instaparse?

2021-07-17 Thread D. Ben Knoble
I haven't touched Clojure in a year or two, and I'm not familiar with 
instaparse.

I can say, from a terminology stand-point, that a grammar (such as one in 
EBNF) can produce a parser, which then produces parse-trees of input 
strings. So, perhaps you mean that you want parse-trees of strings in the 
grammar of EBNF? It took me a few reads to come to this conclusion—the 
expression "get a parse tree of the EBNF" threw me off.

It seems likely that instaparse is producing a parser, and may throw away 
the underlying graph (parse-tree) of the grammar.

Regardless, I have a Scala tool that parses EBNF. I'm not sure about 
interop, but it's all JVM, right? https://github.com/benknoble/loner

On Saturday, July 17, 2021 at 3:21:36 PM UTC-4 jsch...@gmail.com wrote:

>
> Hi all,
>
> I was hoping that I can call
>
> (instaparse.core/parser "my ::= 'ebnf' | 'grammar' ")
>
> to get a parse tree of the EBNF. I'd like to convert the EBNF to a 
> tree-sitter grammar.js.
>
> But when I evaluate the above expression, I only see a the original EBNF 
> input, reformatted, and without comments:
>
> => my = "ebnf" | "grammar"
>
> Is there a way to get hands on the underlying structure, i.e. the parse 
> tree?
>
> Best, Jakob
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/fc191009-45d0-4a0c-9175-c937f15409a5n%40googlegroups.com.


Re: Parse an EBNF grammar with instaparse?

2021-07-17 Thread D. Ben Knoble
I should clarify: it parses a variant of EBNF. The specific syntax is 
explained at https://benknoble.github.io/loner/ 
and https://benknoble.github.io/loner/demo.html#syntax

On Saturday, July 17, 2021 at 8:50:48 PM UTC-4 D. Ben Knoble wrote:

> I haven't touched Clojure in a year or two, and I'm not familiar with 
> instaparse.
>
> I can say, from a terminology stand-point, that a grammar (such as one in 
> EBNF) can produce a parser, which then produces parse-trees of input 
> strings. So, perhaps you mean that you want parse-trees of strings in the 
> grammar of EBNF? It took me a few reads to come to this conclusion—the 
> expression "get a parse tree of the EBNF" threw me off.
>
> It seems likely that instaparse is producing a parser, and may throw away 
> the underlying graph (parse-tree) of the grammar.
>
> Regardless, I have a Scala tool that parses EBNF. I'm not sure about 
> interop, but it's all JVM, right? https://github.com/benknoble/loner
>
> On Saturday, July 17, 2021 at 3:21:36 PM UTC-4 jsch...@gmail.com wrote:
>
>>
>> Hi all,
>>
>> I was hoping that I can call
>>
>> (instaparse.core/parser "my ::= 'ebnf' | 'grammar' ")
>>
>> to get a parse tree of the EBNF. I'd like to convert the EBNF to a 
>> tree-sitter grammar.js.
>>
>> But when I evaluate the above expression, I only see a the original EBNF 
>> input, reformatted, and without comments:
>>
>> => my = "ebnf" | "grammar"
>>
>> Is there a way to get hands on the underlying structure, i.e. the parse 
>> tree?
>>
>> Best, Jakob
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/0cf7ef4c-6d49-46ed-9c4e-26258fe2dbb5n%40googlegroups.com.