Need for | character in code

Discussion in 'AutoCAD' started by David Kozina, Dec 27, 2003.

  1. David Kozina

    David Kozina Guest

    OTHER than for inline or block comments, or perhaps some use WITHIN a
    comment or string, can anyone think of a valid reason (or need) to use the
    pipeline symbol: |
    (I think that's what it's called)
    in their lisp code?

    I know - it's a weird question.
     
    David Kozina, Dec 27, 2003
    #1
  2. David Kozina

    TCEBob Guest

    Well, you could be cute and name a function with it. Not likely anyone
    would accidentally invoke it. (Yes, it works, I just tried it.)

    rs
     
    TCEBob, Dec 27, 2003
    #2
  3. David Kozina

    Fatfreek Guest

    large comment blocks, for one.
    ;| Everything between the two vertical bars
    is considered comments. There is no need to
    prefix each line with a semi-colon.
    There, I've said it.|;
     
    Fatfreek, Dec 27, 2003
    #3
  4. David Kozina

    John Uhden Guest

    I have tons of old code that use the "|" character as a prefix left over from
    the days when local symbols could be exposed via *cancel* or errors. I employed
    the convention as a means to identify any symbols that leaked out into the
    atoms-family. There's nothing wrong with using extended characters in such a
    context, but R15+ brought us the confidence that local symbols would no longer
    be exposed as globals. Thus their usage becomes merely a naming style. Note
    that Autodesk has had "Interoperability" standards for quite some time that
    tries to control the usage of globally named functions and variables so we don't
    step on each other's toes.

    Nowadays, the EXTNAMES variable controls the usage of characters such as "|" in
    symbol tables (not to be confused with symbol names) and what the function
    (snvalid) will return.

    Hope that helps rather than confuses.
     
    John Uhden, Dec 27, 2003
    #4
  5. David Kozina

    ECCAD Guest

    No. I avoid using the pipe symbol (except for delimiter in text)because it looks too much like the (lowercase L). I also try to avoid using (0) and (O).
    Bob Shaw
     
    ECCAD, Dec 27, 2003
    #5
  6. David Kozina

    David Kozina Guest

    It appears, then, that if it's used, it's more a matter of a programmers
    *style*, rather than a necessity - except in perhaps very rare
    circumstances.

    Thanks.

    In case anyone is wondering why I'm asking is that I'm trying to get correct
    syntax highlighting to work in the sequel to ScopeEdit (see my post a few
    days ago regarding some problems I've been having with that code editor.)
    So far, I haven't been successful in getting SE to work on the new 'puter,
    so I've downloaded its succesor called "Interspector" which can open and
    read ScopeEdit formatted files. More importantly, one can create and use a
    language 'plug-in' in order to display syntax highlighting, not unlike the
    VLIDE editor window or the .syn files that can be created in TextPad.

    But, in the little bit of tinkering I've managed to do, the syntax
    highlighting in Interspector appears to work a bit strangely...
    If I define ; to be a single line comment, it works fine.
    But if I then define ;| |; to be an inline (or block) comment, the
    single-line definition of ; seems to rule.

    So, for my next trick, I'm going to see what happens if I just use the |
    character for my block comment start and end delimiters.

    I just wanted to be fairly sure that I wasn't forgetting some other
    important usage of | in AutoLISP coding.

    Not sure if Interspector will work or not - it looks pretty good to me, so
    far, and it *is* running on the new machine (and I've got about 28 more days
    left to test it) - but I thought I'd at least give it a shot.
    It seems to have a lot of potential - I just wish the documentation was a
    better. Michael Puckett should know what I mean about this :)

    Thanks again, good peoples.
     
    David Kozina, Dec 28, 2003
    #6
  7. David Kozina

    John Uhden Guest

    How about just using TextPad with Michael's graciously donated syntax files?
    That's what I do. <Thanks, Michael>
     
    John Uhden, Dec 28, 2003
    #7
  8. David Kozina

    David Kozina Guest

    Yes, I do that, too. But, uh, WHO do you think graciously provided me with
    the base AutoLISP.seo syntax file for ScopeEdit?

    <Thanks, Michael>

    hehehehe,
    David Kozina

    Unfortunately for me, Mr Puckett seems to have not been overly impressed
    with Interspector. So it looks like I may be on my own for this one. The
    Interspector language syntax files are similar enough to ScopeEdit's syntax
    files that I may be able to patch something together that actually sort of
    works, but then again, maybe not.

    ScopeEdit is/was a most useful program. I just want to give Interspector a
    shot, too.
     
    David Kozina, Dec 28, 2003
    #8
Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.