Need for | character in code

  • Thread starter Thread starter David Kozina
  • Start date Start date
D

David Kozina

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 said:
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.

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
 
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.|;
 
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.
 
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
 
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.
 
How about just using TextPad with Michael's graciously donated syntax files?
That's what I do. <Thanks, Michael>
 
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.
 
Back
Top