Skip to content

Commit 437bfe3

Browse files
authored
Dummy array casts (#509)
* Dummy array casts * Remove useless comment
1 parent 2f190b1 commit 437bfe3

File tree

2 files changed

+58
-2
lines changed

2 files changed

+58
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
* Added EDN reader in the `basilisp.edn` namespace (#477)
1515
* Added line, column, and file information to reader `SyntaxError`s (#488)
1616
* Added context information to the `CompilerException` string output (#493)
17-
* Added Array (Python list) functions (#504)
17+
* Added Array (Python list) functions (#504, #509)
1818

1919
### Changed
2020
* Change the default user namespace to `basilisp.user` (#466)

src/basilisp/core.lpy

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,6 @@
15701570
(recur (inc ~idx))))
15711571
~ret))
15721572

1573-
;; (areduce arr idx ret 0 (+ ret (aget arr idx)))
15741573
(defmacro areduce
15751574
"Reduce the Python list `array` by `expr`, returning the reduced expression.
15761575

@@ -1584,6 +1583,63 @@
15841583
(recur ~expr (inc ~idx))
15851584
~ret))))
15861585

1586+
(defn booleans
1587+
"Dummy cast to a Python list of booleans.
1588+
1589+
This function is provided for Clojure compatibility."
1590+
[x]
1591+
x)
1592+
1593+
(defn bytes
1594+
"Dummy cast to a Python list of bytes (distinct from Python's `bytarray` and
1595+
`bytes` types).
1596+
1597+
This function is provided for Clojure compatibility."
1598+
[x]
1599+
x)
1600+
1601+
(defn chars
1602+
"Dummy cast to a Python list of chars.
1603+
1604+
This function is provided for Clojure compatibility."
1605+
[x]
1606+
x)
1607+
1608+
(defn doubles
1609+
"Dummy cast to a Python list of doubles.
1610+
1611+
This function is provided for Clojure compatibility."
1612+
[x]
1613+
x)
1614+
1615+
(defn floats
1616+
"Dummy cast to a Python list of floats.
1617+
1618+
This function is provided for Clojure compatibility."
1619+
[x]
1620+
x)
1621+
1622+
(defn ints
1623+
"Dummy cast to a Python list of integers.
1624+
1625+
This function is provided for Clojure compatibility."
1626+
[x]
1627+
x)
1628+
1629+
(defn longs
1630+
"Dummy cast to a Python list of longs.
1631+
1632+
This function is provided for Clojure compatibility."
1633+
[x]
1634+
x)
1635+
1636+
(defn shorts
1637+
"Dummy cast to a Python list of shorts.
1638+
1639+
This function is provided for Clojure compatibility."
1640+
[x]
1641+
x)
1642+
15871643
;;;;;;;;;;;;;;;;
15881644
;; Exceptions ;;
15891645
;;;;;;;;;;;;;;;;

0 commit comments

Comments
 (0)