Create LISP Guide to Raku#4814
Conversation
Not finished, but making sure this is what y'all want.
|
Thank you for your work so far! I've only dabbled a tiny bit in LISP almost 50 years ago, so I'm going to leave it to other people to see if this makes sense to add to the doc repo! |
coke
left a comment
There was a problem hiding this comment.
I've done only a partial review - looks great so far, I put in a bunch of formatting notes. I'll do a second round with more content-related notes later. (Under some time restrictions at the moment.)
Good work!
|
|
||
| Regardless of your choice of syntax, the noteworthy feature is Raku's | ||
| take on all this. Which is, as best as possible, avoid restricting users | ||
| of their personal methodology. TMTOWTDI, y'all --> there's more than one |
There was a problem hiding this comment.
A link to the acronym in the glossary would be good, especially for LISP folks.
| maybe after some time, you'll end up preferring. One of those things is | ||
| the ubiquitous sigil -- that @ symbol you saw. | ||
|
|
||
| Sigils go before the name of a variable. Raku requires the use of the |
There was a problem hiding this comment.
It is possible to have sigil-less variables in Raku, with the cost of a little syntax:
https://docs.raku.org/language/variables#index-entry-%5C_(sigilless_variables)
| accomodate your thinking/programming style more than any other langauge | ||
| out there. | ||
|
|
||
| Now because LISP users have the first and best REPL in the world, and are |
| accustomed to working within it, the code here will be syntaxed as if | ||
| working from Raku's REPL, unless otherwise noted. | ||
|
|
||
| =header2 Lists |
| problem, and the flexibility to have options is best. | ||
|
|
||
| =header2 Basics of Raku | ||
|
|
|
|
||
| Raku is operator rich, not just compared to Common LISP, but compared to | ||
| all other programming languages out there. By operators I mean any | ||
| in-house functions -- functions that are baked into the |
There was a problem hiding this comment.
You can use a literal mdash here, or an escaped one. Either preferable to the double dash.
| We must quote each symbol or else the system will go look for what the | ||
| symbol evaluates to, just like in LISP. | ||
|
|
||
| The < > operator automatically quotes each symbol separated by space for |
There was a problem hiding this comment.
You can quote the < > here so that it's rendered as code with C«< >»
| 1) There is likely going to be a less optimal way. | ||
| 2) The programmer will eventually face learning those multiple, less | ||
| optimal ways. | ||
|
|
There was a problem hiding this comment.
This will render as a single paragraph. You can use =item
There was a problem hiding this comment.
I understood everything else. But I couldn't find information on =item with search term "markdown basics =item".
Is it as simple as =item 1) foo bar baz
=item 2) foo bar baz
?
There was a problem hiding this comment.
it's rakudoc, not markdown: https://docs.raku.org/language/pod#Lists
There was a problem hiding this comment.
Oh... Wow. Aiming high with this enterprise, I see. Is RakuOS in the works? Haha. Excited to see what y'all have come up with in this markup language.
| empty braces {}, and empty quotes "". And then there is 0. | ||
|
|
||
| I know there are several things that are false, but we have one more, | ||
| which is that types (like List, Str, Int, etc) are interpreted as false. |
There was a problem hiding this comment.
You don't have to do this here, but we'll update all the types in the document to link to their Raku doc page.
|
|
||
| Raku | ||
|
|
||
| if 1 > 0 and 1 + 2 == 3 { "block executes" } # OUTPUT: block executes |
There was a problem hiding this comment.
In general, you can make these look like code blocks by indenting them. you can also wrap them in
=begin code
=end code
If you use this syntax, there's an optional arg you use to specify the language - defaults to Raku.
=begin code :lang<lisp>
=end code
Not finished, but making sure this is what y'all want.
The problem
Solution provided