
listPacker <- function(receiver, ...)  {
  # takes all arguments (...) and appends them to receiver
  #
  # receiver should be list-like
  #  value returned is list-like 
cat("   @. ")
  if (length(list(...)) > 0L) {
    print(..1)
    receiver[length(receiver) + 1L] <- ..1
    if (length(list(...)) > 1L)  {
        receiver <- listPacker(receiver, as.list(substitute(list(...)))[-1L] )    
    }
  } else {
    warning("There were nothing to add to the list.")
  }
  receiver
}


==========
## USING FOR LOOP
listPacker <- function(receiver, ...)  {
cat("   @.
 ")
  # takes all arguments (...) and appends them to receiver
  #
  # receiver should be list-like
  #  value returned is list-like 

  # Grab the call and the arguments
  #  Note 1:  cl[[1]] will be the function name;  cl[[2]] will be argument receiver
  #           All additional arguments will be cl[[3+]];  
  #           if length(cl) < 3, there are no additional arguments
  #  Note 2:  Look at `tes.mtchCl()` to see the difference between ..1  &  cl[[3]] 
  #           when dealing with a list. 
  cl <- match.call(expand.dots = TRUE)

  # first Dot.   In case number of arguments before (...) changes in the future
  fD <- 3L - 1L

  lngArgs <- length(cl) - fD

  if (lngArgs > 0L) {
    for (i in 1L:lngArgs)  {
    cat (" i is ", i, "\t i + fD is", i + fD, "\n\t") # ccl[[i + fD]]  is ",print(cl[[i + fD]]),   "\n\t")      
      receiver[[length(receiver) + i]] <- cl[[i + fD]]  ??  [[1]]
    }
  } else {
    warning("There were nothing to add to the list.")
  }
  receiver
}

a <- listPacker(OrignlList, Q="frstNew", R=456, S="thrdNew", T=list("frthNew_one", "frthNew_two"))  
a


=======

#################################
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#       USING MATCH CALL        #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
##      THIS IS USEFUL       ####

##################################
# sample data for original list
#    
  OrignlList <- 
      list(A = list("OrigFrst_one", "OrigFrst_two"), Blnk = "    ", C = 123, 
          D = list("apples", "oranges"), E = "LAST OF ORIGINAL")
#
###################################


    showStrDots <- function(rec,...) {
      
      # NOTE:   `str(...)`  gives error
      obj <- list(...)
      
      cat("\n\t\t -  str(obj)  -\n")
      str(obj)
      return(obj)
    }
    a.showStrDots <- showStrDots(OrignlList, Q="frstNew", R="secondNew", S="thrdNew", T=list("frthNew_one", "frthNew_two"))  
    a.showRecursive <- showStrDots(OrignlList, showStrDots(OrignlList, Q="frstNew", R="secondNew", S="thrdNew", T=list("frthNew_one", "frthNew_two")))
    a.showRecursive


    #~~~~~~~~~~~~~~~~~~~~~~~~#
    showStrDots.sub <- function(rec,...) {
      
      # NOTE:   `str(...)`  gives error
      obj <- substitute(list(...))
      
      cat("\n\t\t -  str(obj)  -\n")
      str(obj)
      return(obj)
    }
    a.showStrDots.sub <- showStrDots.sub(OrignlList, Q="frstNew", R="secondNew", S="thrdNew", T=list("frthNew_one", "frthNew_two"))  
    a.showRecursive.sub <- showStrDots.sub(OrignlList, showStrDots.sub(OrignlList, Q="frstNew", R="secondNew", S="thrdNew", T=list("frthNew_one", "frthNew_two")))
    a.showRecursive.sub

    

as.list(substitute(list(...)))[-1L]

    #~~~~~~~~~~~~~~~~~~~~~~#

    # b => blank  (ie, expand.dots is explicitly assignemd)
    tes.b <- function(rec,...) {
      return(match.call())
    }

    a.b <- tes.b(OrignlList, Q="frstNew", R="secondNew", S="thrdNew", T=list("frthNew_one", "frthNew_two"))  
    #
    ## LOOK AT THE DIFFERENCE BETWEEN [ ]  and [[ ]]
        a.b[3]
        # "first"()
        a.b[[3]]
        # [1] "first"
        str(a.b[3])
        #  language "first"()
        str(a.b[[3]])
        #  chr "first"
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
    # edF => expand.dots = FALSE
    tes.edF <- function(rec,...) {
      return(match.call(expand.dots = FALSE))
    }

    a.edF <- tes.edF(OrignlList, Q="frstNew", R="secondNew", S="thrdNew", T=list("frthNew_one", "frthNew_two"))  
    #
    ## LOOK AT THE DIFFERENCE BETWEEN [ ]  and [[ ]]
        a.edF[3]

        a.edF[[3]]

        str(a.edF[3])

        str(a.edF[[3]])

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
    # edT => expand.dots = TRUE
    tes.edT <- function(rec,...) {
      return(match.call(expand.dots = TRUE))
    }

    a.edT <- tes.edT(OrignlList, Q="frstNew", R="secondNew", S="thrdNew", T=list("frthNew_one", "frthNew_two"))  
    #
    ## LOOK AT THE DIFFERENCE BETWEEN [ ]  and [[ ]]
        a.edT[3]

        a.edT[[3]]

        str(a.edT[3])

        str(a.edT[[3]])

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#


  ##  NOTE THE DIFFERENCE BETWEEN MATCH CALL AND ..4

  # Testing match.call()  vs.  ..1
  tes.mtchCl <- function(receiver, ...)  {

    # Grab the call and the arguments
    #  Note  cl[[1]] will be the function name;  cl[[2]] will be argument receiver
    #        All additional arguments will be cl[[3+]];  
    #        if length(cl) < 3, there are no additional arguments
    cl <- match.call(expand.dots = TRUE)

    # Display some helpful str() information 
                   cat("\n\t\t -  cl[[3]]  -\n")
     str(cl[[6]])
                    cat("\n\t\t -  ..1  -\n")
     str(..4)

     # return both as list, then check if identical
     return(list(dotted=..4, cl.indexed=cl[[6]]))
  }

  a.mtchCl <- tes.mtchCl(OrignlList, Q="first", R="second", S="third", T=list("two", "members"))  
  identical(unname(a.mtchCl[[1]]), unname(a.mtchCl[[2]]))
  # [1] FALSE
  a.mtchCl[[1]]
  a.mtchCl[[2]]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#





============================

#~
tes <- function(rec, ...) {
  as.list(substitute(list(...)))[-1L] 
  as.list(substitute(list(...)))[-1L]
 
}

tes <- function(rec,...) {
  input_list <- as.list(substitute(list(...)))
  str(input_list)
  NULL
}

tes(OrignlList, Q="frstNew", R="secondNew", S="thrdNew", T=list("frthNew_one", "frthNew_two"))  
tes(OrignlList, Q="frstNew", R="secondNew", S="thrdNew", T=list("frthNew_one", "frthNew_two")) -> t
str(t)



tes <- function(rec, ...) {
  as.list(substitute(list(...)))[-1L] 
  list(...)==..n
 
}
