-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
%%%MAKE-HASH-TABLE is now %%%MAKE-OBJECT.
MAKE-OBJECT: New core function to fill a new object with dynamically generated keys.
- Loading branch information
Sven Michael Klose
committed
Mar 14, 2017
1 parent
c53aa82
commit eb0c21f
Showing
12 changed files
with
60 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
(define-tree-filter quote-keywords (x) | ||
(| (quote? x) | ||
(& (cons? x) | ||
(in? x. 'make-hash-table '%%%make-hash-table))) | ||
(in? x. 'make-hash-table '%%%make-object))) | ||
x | ||
(keyword? x) | ||
`(quote ,x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
environment/transpiler/targets/javascript/core/make-object.lisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(fn make-object (&rest x) | ||
(!= (%%%make-object) | ||
(@ (i (group x 2) !) | ||
(%%%=-aref .i ! i.)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
(defun array? (x) | ||
(fn array? (x) | ||
(| (is_a x "__array") | ||
(is_array x))) | ||
|
||
(defun %array-push (arr x) | ||
(fn %array-push (arr x) | ||
(%= (%%native "$" arr "[]") x) | ||
x) | ||
|
||
(defun array-push (arr x) | ||
(fn array-push (arr x) | ||
(? (is_a x "__array") | ||
(arr.p x) | ||
(%array-push arr x)) | ||
x) | ||
|
||
(defun list-array (x) | ||
(fn list-array (x) | ||
(let a (make-array) | ||
(@ (i x a) | ||
(a.p i)))) | ||
|
||
(defun list-phphash (x) | ||
(let a (%%%make-hash-table) | ||
(@ (i x a) | ||
(%= (%%native "$" a "[]") i)))) | ||
(fn list-phphash (x) | ||
(!= (%%%make-object) | ||
(@ (i x !) | ||
(%= (%%native "$" ! "[]") i)))) | ||
|
||
(defun aref (a k) | ||
(fn aref (a k) | ||
(? (is_array a) | ||
(php-aref a k) | ||
(href a k))) | ||
|
||
(defun (= aref) (v a k) | ||
(fn (= aref) (v a k) | ||
(? (is_array a) | ||
(=-php-aref v a k) | ||
(=-href v a k))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters