
Hey folks. A quick question about Pattern Matching (I’m rather new to it). Say I wish to match a list which contains some-pattern, where that pattern could be anywhere in the list (beginning, middle, end), how would I describe that? For example, say I always wish to find the pattern c
repeated three times:
( a b c c c d)
(c c c)
(a b d c c c)

I’ve tried using the __k
-style patterns, but they seem good if you know how many elements appear before or after your given pattern. Also, list-no-order
doesn’t seem to help, and I don’t think list-rest
will be of much use, either (from the docs).

How about the following pattern?
`(,_ ... c c c ,_ ...)

Hi @leafac I tried to test your pollen-component package but it fails with the following message: DrRacket install: cannot use empty checksum for Git repostory package source
source: <https://git.leafac.com/pollen-component.git>

@githree: First, thanks for the interest :slightly_smiling_face: Second, we’re trying to figure this out: https://github.com/tonyg/racket-pkg-website/issues/36 Third, for the moment:
$ git clone <https://git.leafac.com/pollen-component>
$ cd pollen-component
$ raco pkg install

Installation will fail if you don’t have LaTeX and ImageMagick installed, because of one figure in the documentation.

Can you tell that this is my first time packaging Racket code? :stuck_out_tongue:

While I’m still working on these issues with installation, the library code itself is functional. You can see it used in https://www.leafac.com, for which the source is here: https://git.leafac.com/www.leafac.com/tree/source/pollen.rkt

Feedback is greatly appreciated!

Great, thanks for detailed answer! I wonder if it is possible to make a dependency like the one for LaTeX and ImageMagick optional - it seems like a bit of an overkill for just one figure - could there be a backup .png if dependency is not found. This is more general question not only related to your package. Does anyone have any example of how something like this can be achieved?

I agree that LaTeX and ImageMagick must be optional. In fact, I included the generated .png
in the repository. But raco pkg install
acts funny and looks for the image in the root of the repository—as opposed to DrRacket’s Render as HTML, which looks in the documentation folder. I’m working on these issues as we speak.

For the moment, if you want to read the documentation and you don’t have LaTeX and ImageMagick, open documentation/pollen-component.scrbl
in DrRacket and render it :slightly_smiling_face:

The library is fully documented. It’s just a packaging issue at the moment.

Looking forward to playing with components, I like the idea behind it, so good luck!

Thanks for the kind words. In a couple of weeks this should be ready for consumption. I’ll announce it on the mailing list.