Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Michael Klose committed Mar 20, 2017
2 parents 30a245e + 7ea88ce commit 09a12db
Show file tree
Hide file tree
Showing 11 changed files with 149 additions and 122 deletions.
10 changes: 10 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
Changes of tre-0.6 relative to tre-0.5:
* PHP: PROPERTY-NAMES fixed for associative arrays.
* PHP: ASSOC-ARRAY? test if first key is a string.
* Curly brackets {} denote MAKE-OBJECT if the first element
is a string or keyword.
* MAKE-OBJECT, NEW, {}: Also takes keywords whose symbol names
are converted to downcase as property names.
* JS/PHP: COPY-PROPERTIES, MERGE-PROPERTIES, UPDATE-PROPERTIES:
New functions.

Changes of tre-0.5 relative to tre-0.4:
* LOG-MESSAGE returns its argument if logging has been
switched off.
Expand Down
204 changes: 102 additions & 102 deletions boot-common.lisp

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion environment/stage1/curly.lisp
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
(defmacro curly (&rest x)
`(progn ,@x))
(? (| (string? x.)
(keyword? x.))
`(make-object ,@x)
`(progn ,@x)))
4 changes: 3 additions & 1 deletion environment/transpiler/environment/make-object.lisp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(fn make-object (&rest x)
(!= (%%%make-object)
(@ (i (group x 2) !)
(%%%=-aref .i. ! i.))))
(%%%=-aref .i. ! (? (symbol? i.)
(downcase (symbol-name i.))
i.)))))
13 changes: 13 additions & 0 deletions environment/transpiler/environment/property.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,16 @@
(& x
(aprog1 (new)
(@ [= (aref ! _.) ._] x))))

(fn merge-properties (a b)
(aprog1 (new)
(@ (i (property-names a))
(= (aref ! i) (aref a i)))
(@ (i (property-names b))
(= (aref ! i) (aref b i)))))

(fn copy-properties (x)
(merge-properties x nil))

(fn update-properties (x &rest props)
(merge-properties x (apply #'make-object props)))
1 change: 1 addition & 0 deletions environment/transpiler/targets/javascript/core/atom.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

(fn assoc-array? (x)
(& (object? x)
(not (array? x))
(not (defined? x.__tre-test))
(not (defined? x.__class))))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
(fn property-names (x)
(carlist (%property-list x)))
(& x
(carlist (%property-list x))))
5 changes: 2 additions & 3 deletions environment/transpiler/targets/php/core/objectp.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
(is_object x))

(fn assoc-array? (x)
(& (not (array? x))
(is_array x)
(is_int (key x))))
(& (is_array x)
(is_string (key x))))
5 changes: 4 additions & 1 deletion environment/transpiler/targets/php/core/property-names.lisp
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
(fn property-names (x)
(array-list (array_keys (get_object_vars x))))
(& x
(array-list (array_keys (? (object? x)
(get_object_vars x)
x)))))
16 changes: 4 additions & 12 deletions environment/version.lisp
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
(defvar *tre-revision* 0)
; ,(with-open-file in (open "environment/_current-version" :direction 'input)
; (let l (string-list (read-line in))
; (list-string
; (alet (subseq l
; (!? (position #\: l)
; (++ !)
; 0)
; (-- (length l)))
; (? (== #\M (car (last !)))
; (butlast !)
; !))))))
(var *tre-revision*
,(with-open-file in (open "environment/_current-version" :direction 'input)
(+ 3291 ; Repository 'tre-historic'.
(read-number in))))
5 changes: 4 additions & 1 deletion make.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/sh
# tré – Copyright (c) 2005–2016 Sven Michael Klose <pixel@hugbox.org>

set -e

# Get revision number and date.
git log | grep ^commit | wc -l >environment/_current-version
date >environment/_release-date

ARGS="$2 $3 $4 $5 $6 $7 $8 $9"

SBCL="sbcl --noinform"
Expand Down

0 comments on commit 09a12db

Please sign in to comment.