OMG Lightweight Log

Discussion in 'C++' started by tjr7933, May 17, 2005.

  1. tjr7933

    tjr7933 Guest

    Has anyone implemented the OMG lightweight log spec into a c++
    application?
    #! rnews 1946
    Xref: xyzzy comp.lang.lisp:150483
    Newsgroups: comp.lang.lisp
    Path: xyzzy!nntp
    From: Jeffrey Cunningham <>
    Subject: PCL question about using &rest and &key parameters together
    X-Nntp-Posting-Host: medea.sea.boeing.com
    Content-Type: text/plain; charset=ISO-8859-1
    Message-ID: <>
    User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
    Sender: (Boeing NNTP News Access)
    Content-Transfer-Encoding: 8bit
    Organization: The Boeing Company
    Mime-Version: 1.0
    Date: Tue, 17 May 2005 18:19:25 GMT

    I was reading in Seibel's PCL the following:

    You can safely combine &rest and &key parameters, but the behavior may be
    a bit surprising initially. Normally the presence of either &rest or &key
    in a parameter list causes all the values remaining after the required and
    &optional parameters have been filled in to be processed in a particular
    way--either gathered into a list for a &rest parameter or assigned to the
    appropriate &key parameters based on the keywords. If both &rest and &key
    appear in a parameter list, then both things happen--all the remaining
    values, which include the keywords themselves, are gathered into a list
    that's bound to the &rest parameter, and the appropriate values are also
    bound to the &key parameters.

    So I tried the following:

    (defun foo (a &rest rest &key b c)
    (list a rest b c))

    (foo 1 2 :b 3 :c 4)

    When I run it from slime, it bombs with the following error message:

    Function called with odd number of keyword arguments.
    [Condition of type KERNEL:SIMPLE-PROGRAM-ERROR]

    Restarts:
    0: [ABORT] Abort handling SLIME request. 1: [ABORT] Return to Top-Level.

    Backtrace:
    0: (C::%ODD-KEYWORD-ARGUMENTS-ERROR)
    1: (NIL 1 (2 :B 3 :C 4) 5)[:OPTIONAL] 2: (SWANK::EVAL-REGION "(foo 1 2
    :b 3 :c 4)

    Any idea why this doesn't work as expected? I'm using CMUCL.

    Thanks
    --jeff cunningham
     
    tjr7933, May 17, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt Berther
    Replies:
    0
    Views:
    429
    Matt Berther
    Apr 16, 2004
  2. vertigo

    org.omg.PortableServer.POA

    vertigo, Apr 3, 2004, in forum: Java
    Replies:
    0
    Views:
    378
    vertigo
    Apr 3, 2004
  3. Replies:
    0
    Views:
    467
  4. Replies:
    0
    Views:
    2,258
  5. Replies:
    0
    Views:
    1,197
Loading...

Share This Page