Q7

EList is not EObject

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.0.0
  • Fix Version/s: 1.3.x
  • Component/s: ECL
  • Labels:
    None
  • Test Mode:
    Manual

Description

As a result, we cannot put two values in with block. We can box lists into eobjects in the same way as we do with ints and floats
examples:

with [list 1 2 3] 
{
  get 1 | print
  foreach { log }
}

Activity

Hide
komaz added a comment - 20/Aug/13 8:13 PM - edited

Description is incomplete. Example above assumes that 'with' implicitly 'unboxes' list and writes all objects into an input pipe of 'do' block. Not sure about this behavior.

It seems that we need more commands:

  • list arg1 arg2 arg3 – 'constructs' a list
  • emit 1 2 3 4 5 | as-list – takes all objects from input pipe and returns them as a single list
  • flatten
    [list 1 2 3 4 5]
    – 'destructs' a list

However it is unclear how to pass list contents as several parameters to existing command, accepting 'varargs'. For instance, we have a 'concat' command, which concatenates string arguments. And suppose I have a list of strings:

let [val strs [list "a" "b" "c"]] {
   //how to pass these strings to 'concat'?
   concat $list // variant 1, seems too 'magic'
                // probably 'concat' is a bad example as we have enough type information
                // but in general for a command accepting arbitrary number of eobjects in this
                // case it is unclear whether user wants to pass list values as separate arguments
                // or list as a single object
   apply concat $list // clojure-style
                      // unclear what to do with other arguments and
                      // what to do if a list argument is not the only/the first argument

}

Therefore, I'd suggest until we meet a real need for that to have a better understanding

Show
komaz added a comment - 20/Aug/13 8:13 PM - edited Description is incomplete. Example above assumes that 'with' implicitly 'unboxes' list and writes all objects into an input pipe of 'do' block. Not sure about this behavior. It seems that we need more commands:
  • list arg1 arg2 arg3 – 'constructs' a list
  • emit 1 2 3 4 5 | as-list – takes all objects from input pipe and returns them as a single list
  • flatten
    [list 1 2 3 4 5]
    – 'destructs' a list
However it is unclear how to pass list contents as several parameters to existing command, accepting 'varargs'. For instance, we have a 'concat' command, which concatenates string arguments. And suppose I have a list of strings:
let [val strs [list "a" "b" "c"]] {
   //how to pass these strings to 'concat'?
   concat $list // variant 1, seems too 'magic'
                // probably 'concat' is a bad example as we have enough type information
                // but in general for a command accepting arbitrary number of eobjects in this
                // case it is unclear whether user wants to pass list values as separate arguments
                // or list as a single object
   apply concat $list // clojure-style
                      // unclear what to do with other arguments and
                      // what to do if a list argument is not the only/the first argument

}
Therefore, I'd suggest until we meet a real need for that to have a better understanding

People

  • Assignee:
    komaz
    Reporter:
    komaz
Vote (0)
Watch (0)

Dates

  • Created:
    12/Sep/12 1:55 PM
    Updated:
    20/Aug/13 8:13 PM