On Sat, Jan 26, 2008 at 18:43:50 -0800, Jonathan Lang wrote:
> Right. One last question: is this (i.e., extending a string's
> grammar) a "keep simple things simple" thing, or a "keep difficult
> things doable" thing?
I'm going to guess somewhere in between.
It should be about the same level of
Yuval Kogman wrote:
> You can subclass the grammar and change everything.
>
> Theoretically that's a "yes" =)
Right. One last question: is this (i.e., extending a string's
grammar) a "keep simple things simple" thing, or a "keep difficult
things doable" thing?
--
Jonathan "Dataweaver" Lang
On Sat, Jan 26, 2008 at 18:12:17 -0800, Jonathan Lang wrote:
> This _does_ appear to be something more suitable for a Locale::
> module. I just wonder if there are enough hooks in the core to allow
> for an appropriately brief syntax to be introduced in a module: can
> one roll one's own string "
On Sat, Jan 26, 2008 at 08:58:43AM -0800, Larry Wall wrote:
> Last night I got a message entitled: "yum: 1 Updates Available".
> Of course, that's probably just a Python programmer giving up on doing
> the right thing, but we see this sort of bletcherousness all the time.
>
> Any other cute ide
Gianni Ceccarelli wrote:
> Please don't put this in the language. The problem is harder than it
> seems (there are European languages that pluralize differently on $X %
> 10, IIRC; 0 is singular or plural depending on the language, etc etc).
-snip-
> I know Perl is not "minimal", but sometimes I
On Sat, Jan 26, 2008 at 02:36:32PM -0800, chromatic wrote:
>
> Nearly pain-free l10n and i18n *is* kind of a killer feature though.
+1
> -- c
>
--
Its only English centric if the idea is fixed to plurals, because its
only for plurals where English words are mutated by grammar rules.
In other languages, words are mutated by other factors, such as the
gender of the word, the case, and the number.
The problem can be quite difficult, say in
On 2008-01-26 Larry Wall <[EMAIL PROTECTED]> wrote:
> Last night I got a message entitled: "yum: 1 Updates Available".
> [snip a lot]
> I think that probably handles most of the Indo-European cases, and
> anything more complicated can revert to explicit code. (Or go though
> a localization diction
On Sat, Jan 26, 2008 at 08:58:43AM -0800, Larry Wall wrote:
> After a recent exchange on PerlMonks about join, I've been thinking
> about the problem of pluralization in interpolated strings, where we
> get things like:
>
> say "Received $m message{ 1==$m ?? '' !! 's' }."
>
> My first thought
At 8:58 AM -0800 1/26/08, Larry Wall wrote:
My first thought is that this is such a common idiom that we ought
to have some syntactic sugar for it:
say "Received $m message\s."
I don't think that a feature like this should be in the core
language; it is too complicated as well as an open-
On Saturday 26 January 2008 08:58:43 Larry Wall wrote:
> That would cover most of the cases for English speakers using regular
> nouns, but I wonder whether there's some kind of generalization that
> would help for cases like:
>
> say "There was/were $o ox/oxen"
That makes me wish for a subju
To me this sounds like
use Lingua::EN::Pluralize::DSL;
which would overload your grammar locally to parse strings this way.
However, due to i18n reasons this should not be in the core.
It might make sense to ship a slightly modernized Locale::MakeText
with Perl 6 so that it can be used
Amir E. Aharoni wrote:
On 26/01/2008, Larry Wall <[EMAIL PROTECTED]> wrote:
After a recent exchange on PerlMonks about join, I've been thinking
about the problem of pluralization in interpolated strings, where we
get things like:
say "Received $m message{ 1==$m ?? '' !! 's' }."
...
Any
"Jonathan Lang" schreef:
> I'm not fond of the 'ox\soxen' idea; but I could get behind something
> like '\s' or 'ox\s'.
"$n ox\s< en>"
"$n\s cat\s< s > fight\s< s s>"
;)
--
Affijn, Ruud
"Gewoon is een tijger."
Jonathan makes an excellent point about s and S. In fact, there's
probably a "little language" out there for this.
I don't think it needs to be in the core, though. But you could put in
some kind of "hook" mechanism, so that detecting the presence of \s or
whatever caused the string to be trea
Larry Wall wrote:
> Any other cute ideas?
If you have '\s', you'll also want '\S':
"$n cat\s fight\S" # 1 cat fights; 2 cats fight
I'm not fond of the 'ox\soxen' idea; but I could get behind something
like '\s' or 'ox\s'.
'\s' would mean 'a is singular; b is plural'
'\s' would be short for '\s<
On 26/01/2008, Larry Wall <[EMAIL PROTECTED]> wrote:
> After a recent exchange on PerlMonks about join, I've been thinking
> about the problem of pluralization in interpolated strings, where we
> get things like:
>
> say "Received $m message{ 1==$m ?? '' !! 's' }."
>
> ...
>
> Any other cute id
Last night I got a message entitled: "yum: 1 Updates Available".
Of course, that's probably just a Python programmer giving up on doing
the right thing, but we see this sort of bletcherousness all the time.
After a recent exchange on PerlMonks about join, I've been thinking
about the problem of pl
18 matches
Mail list logo