Author Topic: ACET... functions  (Read 7728 times)

0 Members and 1 Guest are viewing this topic.

Joe Burke

  • Guest
Re: ACET... functions
« Reply #15 on: May 14, 2009, 12:35:27 PM »
Luis my freind?

Is that you on the other end?

If so, I can't imagine why you would disguise your identity. It is after all your claim to fame.

Everyone within the programming community has benefitted by your generous wisdom.

Whatever drove you to this this point should be put in the shit can and ignored. Regardless of origin.

Regards
Joe

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: ACET... functions
« Reply #16 on: February 01, 2013, 03:22:35 PM »
There is some news I don΄t know ? Have the same questions as Lee. No documentation what it means all acet... !

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1453
  • Marco
Re: ACET... functions
« Reply #17 on: February 02, 2013, 03:12:11 AM »
If we want to be precise, there are two ACET-... functions that are now embedded in AutoCAD:
ACET-LAYERP-MARK ACET-LAYERP-MODE

Exploring (atoms-family ..) in my versions 2013 Mechanical I found some things
I do not remember anything about.

Does anyone know anything?

Comando: !_MATTS_UTIL
#<SUBR @0000000028998930 <EXRXSUBR>>

Comando: !PRAGMA
#<SUBR @000000002899d458 PRAGMA>

Comando: !VL-INFP
#<SUBR @000000000b452b10 VL-INFP>

Comando: (VL-NANP 0)
nil

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: ACET... functions
« Reply #18 on: February 02, 2013, 08:58:38 AM »
Don't know of all those others, will have to investigate. From that vl-nanp's name I can only surmise it "should" have been something like a predicate to test if a value if Not-A-Number. But it seems to be broken - such predicates should not error out when they get other types of values in their parameters, especially if they're testing for something which "isn't".:
Code: [Select]
_$ (vl-nanp "1")
_$ (vl-nanp 0)
nil
_$ (vl-nanp t)
; error: bad argument type: numberp: T
_$ (vl-nanp 0.1)
nil_$ (vl-nanp (entlast))
_$ (vl-nanp '(1 2 3))
_$ (vl-nanp nil)
; error: bad argument type: numberp: nil
So sending a string / ename / list returns nothing, sending T / nil errors out. IMO less than useful!

Edit: Anyhow, if that is the correct reason behind the vl-nanp function it's quite simple to roll your own:
Code - Auto/Visual Lisp: [Select]
  1. (defun nan-p (arg) (not (member (type arg) '(Int Real))))

PPS: And anyway, why not use the built-in numberp in any case? Makes it even easier:
Code - Auto/Visual Lisp: [Select]
  1. (defun nan-p (arg) (not (numberp arg)))
« Last Edit: February 02, 2013, 09:06:52 AM by irneb »
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: ACET... functions
« Reply #19 on: February 02, 2013, 09:15:14 AM »
As for the _MATTS_UTIL, it seems to be something which tests if an attribute is a multi-line attrib. Returns T if sent the ename of a MAttrib, else returns nil.

Will do some more googling and/or hacking to see if I can get something on the rest of them.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: ACET... functions
« Reply #20 on: February 02, 2013, 09:19:02 AM »
vl-infp tests for reals exceeding the maxmimum storable value, e.g. for 32-bit Doubles:

Code - Auto/Visual Lisp: [Select]
  1. _$ (vl-infp 1.7e308)
  2. nil
  3. _$ (vl-infp 1.8e308)
  4. T

pragma may be used to protect / unprotect symbols - there are many examples of its use if you search the forum.


irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: ACET... functions
« Reply #21 on: February 02, 2013, 09:21:37 AM »
You're correct, just found this: http://www.cadtutor.net/forum/showthread.php?61972-Oldie-but-a-Goodie-PRAGMA-!
Thanks to RenderMan for that bit of info  :kewl:

So the vl-infp means: predicate on infinity  ;) . Thanks, was getting round to it I guess.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: ACET... functions
« Reply #22 on: February 02, 2013, 09:22:10 AM »

BlackBox

  • King Gator
  • Posts: 3770
Re: ACET... functions
« Reply #23 on: February 02, 2013, 09:34:18 AM »
You're correct, just found this: http://www.cadtutor.net/forum/showthread.php?61972-Oldie-but-a-Goodie-PRAGMA-!
Thanks to RenderMan for that bit of info  :kewl:

Cheers dude *Tips hat*
"How we think determines what we do, and what we do determines what we get."

hmspe

  • Bull Frog
  • Posts: 362
Re: ACET... functions
« Reply #24 on: February 02, 2013, 03:31:27 PM »
_MATTS_UTIL may do a bit more than that.  It is used in burst.lsp:
Code: [Select]
      (if (_MATTS_UTIL ANAME)
         (progn
            ; Multiple Line Text Attributes (MATTS) -
            ; make an MTEXT entity from the MATTS data
            (_MATTS_UTIL ANAME 1)
         )
"Science is the belief in the ignorance of experts." - Richard Feynman

owenwengerd

  • Bull Frog
  • Posts: 451
Re: ACET... functions
« Reply #25 on: February 02, 2013, 04:53:02 PM »
PPS: And anyway, why not use the built-in numberp in any case?

Your proposed alternatives to (vl-nanp) would not be the same thing. I'm not familiar with the (vl-nanp) function, but assuming its name implies its purpose, then it should only accept a floating point number as its argument, and it should only return T when that number is a NaN, which is a very specific floating point value that represents an otherwise unrepresentable numerical result of a calculation.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: ACET... functions
« Reply #26 on: February 02, 2013, 06:43:57 PM »
The vl-nanp function seems to be redundant since operations such as (/ 0 0), (sqrt -1) or (expt 0 0) in order to produce a NaN result will cause an error during evaluation so the result cannot be tested.
« Last Edit: February 02, 2013, 06:48:54 PM by Lee Mac »

owenwengerd

  • Bull Frog
  • Posts: 451
Re: ACET... functions
« Reply #27 on: February 02, 2013, 10:18:21 PM »
Lee, it may not be possible to produce a NaN from built-in functions, but I expect that non-built-in functions can return NaN (also, I don't think dividing by zero produces a NaN).

HasanCAD

  • Swamp Rat
  • Posts: 1422

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: ACET... functions
« Reply #29 on: February 03, 2013, 08:40:13 AM »
also, I don't think dividing by zero produces a NaN

Dividing 0/0 should since as far as I know all indeterminate forms should return a NaN result.