The Ion Element Kotlin library includes some extension functions that are not specific to Ion. The concept of tag, head, and tail are not specific to Ion, and are not cohesive with the rest of this library.
Clients can still re-implement these extension functions if necessary. However, they shouldn't need to because there are KotlinStdlib functions (first() and drop(n: Int)) that can accomplish the same thing. For example:
// To assume and get the symbol text of the first element of a sequence (aka the "tag")
val tag = mySeqElement.values.first().symbolValue
// To get the head of a sequence
val head = mySeqElement.values.first()
// To get the tail of a sequence
val tail = mySequence.values.drop(1)
// To get the head of a List<AnyElement>
val headOfList = anyElementList.first()
// To get the tail of a List<AnyElement>
val tailOfList = anyElementList.drop(1)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available:
None
Description of changes:
The Ion Element Kotlin library includes some extension functions that are not specific to Ion. The concept of
tag
,head
, andtail
are not specific to Ion, and are not cohesive with the rest of this library.Clients can still re-implement these extension functions if necessary. However, they shouldn't need to because there are KotlinStdlib functions (
first()
anddrop(n: Int)
) that can accomplish the same thing. For example:By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.