@@ -15,12 +15,12 @@ func ToSlice(x any) []any {
1515 if IsNil (x ) {
1616 return []any {}
1717 }
18-
18+
1919 // Handle []any - return as-is
2020 if slice , ok := x .([]any ); ok {
2121 return slice
2222 }
23-
23+
2424 // Handle IPersistentVector
2525 if vec , ok := x .(IPersistentVector ); ok {
2626 count := vec .Count ()
@@ -30,7 +30,7 @@ func ToSlice(x any) []any {
3030 }
3131 return res
3232 }
33-
33+
3434 // Handle IPersistentMap - convert to array of MapEntry objects
3535 if m , ok := x .(IPersistentMap ); ok {
3636 seq := m .Seq ()
@@ -41,7 +41,7 @@ func ToSlice(x any) []any {
4141 }
4242 return res
4343 }
44-
44+
4545 // Handle Set - convert to array of values
4646 if s , ok := x .(* Set ); ok {
4747 seq := s .Seq ()
@@ -52,7 +52,7 @@ func ToSlice(x any) []any {
5252 }
5353 return res
5454 }
55-
55+
5656 // Handle string - convert to character array
5757 if s , ok := x .(string ); ok {
5858 runes := []rune (s ) // Important: use runes for proper Unicode handling
@@ -62,7 +62,7 @@ func ToSlice(x any) []any {
6262 }
6363 return res
6464 }
65-
65+
6666 // Handle ISeq
6767 if s , ok := x .(ISeq ); ok {
6868 res := make ([]interface {}, 0 , Count (x ))
@@ -71,7 +71,7 @@ func ToSlice(x any) []any {
7171 }
7272 return res
7373 }
74-
74+
7575 // Handle reflection-based slice/array
7676 xVal := reflect .ValueOf (x )
7777 if xVal .Kind () == reflect .Slice || xVal .Kind () == reflect .Array {
@@ -81,7 +81,7 @@ func ToSlice(x any) []any {
8181 }
8282 return res
8383 }
84-
84+
8585 // Error with Clojure-style message
8686 panic (NewIllegalArgumentError (fmt .Sprintf ("Unable to convert: %T to Object[]" , x )))
8787}
0 commit comments