Cons 1

Discussion in 'AutoCAD' started by Adesu, Feb 18, 2004.

  1. Adesu

    Adesu Guest

    I am interpreting a program lisp from someone,like this;
    (cons 1 (strcat Ade (itoa 55)))
    (strcat Ade (itoa 55))-----> "Ade55"
    (cons) ------>Adds an element at the beginning of a list
    (cons 1 -----> ?????
    I don't know what meaning of cons 1 (meaning value "1"),can anybody help me
    to explain it
    Thanks you for your attentions
    Best regards
    Ade Suharna
     
    Adesu, Feb 18, 2004
    #1
  2. Adesu

    bruno Guest

    Adesu:

    (cons 1 "hello") return (1 . "hello")
     
    bruno, Feb 18, 2004
    #2
  3. Adesu

    naujoke Guest

    (cons 1 (strcat "Ade" (itoa 55))) -----> (1 . "Ade55")
     
    naujoke, Feb 18, 2004
    #3
  4. Adesu

    naujoke Guest

    (cons 1 (list (strcat "Ade" (itoa 55)))) ----> (1 "Ade55")
     
    naujoke, Feb 18, 2004
    #4
  5. Adesu

    Scot-65 Guest

    :

    Ade,

    CONS is used to CONStruct a DOTTED PAIR.
    This function is used when the DFX code number
    (tag) requires a new Value assigned to it.

    A dotted pair is the basis of computers.

    The DFX code (tag) of 1 is text value. It is a String.
    There are also DFX codes for Integers and Reals.

    The computer does not know what your text value is,
    so a TAG is assigned to store this information.

    The computer will then extract the value assigned
    to the tag for intepretation.

    This example the tag of 1 is string of text.
    This string of text is displayed on the screen.
    Others include layer name (8), color (62)
    and linetype (6). Text position, scale factors, heights,
    and endless other tags are also present here.

    If ADE = "Speed Limit "
    and ITOA means convert a Integer into a String,
    STRCAT is combine => which results "Speed Limit 55".

    Look at this... ADE="Speed Limit " <--- a dotted pair!

    ...........

    Look inside any INI file and you see a pattern "="...
    Tag is set to a value. Tag and value are separated with
    an equal sign. The INI file also has headers
    (or divisions) separating a group of tags.

    Also look in the registry. Start button, Run, and fill
    in the field with "REGEDIT". Expand the folders and you
    will see tags with corresponding values assigned to the
    tag.

    ..............

    All programs that require (custom) settings will
    have this dotted pair to interpret.

    Each editor will have its own unique tag structure.
    When writing lisp for AutoCAD, it is helpful to know
    the DFX codes (tag structure).

    You cannot assign a new tag; just new values.


    Does this make any sense?


    Footnote: APPEND is used to add a dotted pair to an entity
    when the pair is not present. Example includes forcing
    a color, linetype, or linetype scale to the entity
    (through CHPROP). Some tags are mandatory, others optional.


    CONVERSIONS BETWEEN REALS, INTEGERS and STRINGS:
    ITOA = Integer to alpha (string).
    RTOS = Real to string.
    DISTOF = String to Real. (don't ask why it is not ATOR)
    ATOI = Alpha (string) to Integer.
    FIX = Real to Integer.


    Hope this helps...


    Scot-65
     
    Scot-65, Feb 19, 2004
    #5
  6. Adesu

    Adesu Guest

    Thanks to alls,I got information more than I read on a book,thanks a lot
    Best regards
    Ade Suharna
     
    Adesu, Feb 19, 2004
    #6
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.