[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Pattern matching issues
From: |
Panicz Maciej Godek |
Subject: |
Re: Pattern matching issues |
Date: |
Wed, 13 Jul 2011 12:42:09 +0200 |
2011/7/13 Marco Maggi <address@hidden>:
> Panicz Maciej Godek wrote:
>
>> I've been wondering if there is a way to represent this
>> sort of pattern for the pattern matcher provided by Wright
>> (and Guile).
>
> The syntax should be something like:
>
> (match '(Mr Hulot and I need a vacation)
> ((?x ... 'need ?y ...)
> (write (list ?x ?y))
> (newline)))
>
> but at present multiple ellipses are not supported at the
> same level (that is in the same list or the same vector).
> It is possible to do it, but a policy (greedy/non-greedy)
> must be adopted to solve ambiguous cases and it gets
> complicated.
I agree that it could get complicated for the ambiguous cases,
but it should at least be possible for the simple ones. I think that
the lack of this capability is a serious limitation of a pattern
matcher. I'm not well acquainted with regular expressions, but
I could try to resolve this issue upon the book that I'm currently
reading -- provided that there's no one dealing with it at the
moment
Regards
M.