Menu

#193 Clarification on Empty Lists

Minor_Bug
open
7
2005-07-14
2003-09-05
Anonymous
No

I see a problem with lists: there is no difference between an empty list
and a list with one element which has a value of null. That is, the
list "" can either match against nothing (score 0 on a match against "\r";
score 0 on a match against "\r\r"; etc.) or match the empty element
(score 2 on a match against "\r"; score 3 on a match against "\r\r"; etc.).

Is this a problem in practice? Does fuzzball have a policy on how the
list "" should be interpreted?

--
Alfie <alfie@leaflock.homeip.net>

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Oops, thinko: s/match against nothing/match nothing/

    --
    Alfie <alfie@leaflock.homeip.net>

     
  • Nobody/Anonymous

    Logged In: NO

    Oops, thinko: s/match agaisnt nothing/match nothing/

    --
    Alfie <alfie@leaflock.homeip.net>

     
  • Nobody/Anonymous

    Logged In: NO

    Another example is {count:\r}, which returns 2, and {count:}, which returns 0.
    So "count" considers "" to be an empty list. This can be a bit odd since
    {count:{lunique:\r}} returns 0 instead of 1.

    So far I haven't encountered any real-world problems due to this ambiguity.
    I imagine most mpi users probably don't notice it.

    --
    Alfie <alfie@leaflock.homeip.net>

     
  • Natasha O'Brien

    Natasha O'Brien - 2003-09-12

    Logged In: YES
    user_id=9698

    This is also the source of confusion over {lremove}'s
    behavior, really. Deciding how empty lists vs one-entry
    lists containing the empty string behave would clear up the
    edge cases for many list functions.

     
  • Points

    Points - 2003-09-13
    • priority: 5 --> 3
    • assigned_to: nobody --> revar
     
  • Wyld

    Wyld - 2005-07-13
    • priority: 3 --> 7
     
  • Wyld

    Wyld - 2005-07-14
    • labels: --> Included MPI Script
    • milestone: --> Minor_Bug
     

Log in to post a comment.