Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added undefined?
  • Loading branch information
Gabriano committed Aug 10, 2012
1 parent 44df481 commit 561beca
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
29 changes: 26 additions & 3 deletions gsc/_t-univ.scm
Expand Up @@ -848,6 +848,9 @@


((vector? obj) ((vector? obj)
(univ-vector ctx obj)) (univ-vector ctx obj))

((undefined? obj)
(univ-undefined ctx))


(else (else
(gen "UNIMPLEMENTED_OBJECT(" (gen "UNIMPLEMENTED_OBJECT("
Expand Down Expand Up @@ -942,8 +945,6 @@ function Gambit_buildrest ( f ) { // nb formal args
// *** assume (= univ-nb-arg-regs 3) for now *** // *** assume (= univ-nb-arg-regs 3) for now ***
var nb_static_args = f - 1; var nb_static_args = f - 1;
var nb_rest_args = Gambit_nargs - nb_static_args; var nb_rest_args = Gambit_nargs - nb_static_args;
print(\"nb_rest_args: \");
print(nb_rest_args);
var rest = null; var rest = null;
var Gambit_reg = []; var Gambit_reg = [];
Gambit_reg[1] = " R1 "; Gambit_reg[1] = " R1 ";
Expand Down Expand Up @@ -1492,7 +1493,7 @@ function Gambit_lbl1_real_2d_time_2d_milliseconds ( ) { // real-time-millisecond
return Gambit_wrong_nargs(Gambit_lbl1_display); return Gambit_wrong_nargs(Gambit_lbl1_display);
} }
Gambit_rer[1] = new Date(); " R1 " = new Date();
return " R0 "; return " R0 ";
} }
Expand Down Expand Up @@ -2521,6 +2522,28 @@ EOF
(compiler-internal-error (compiler-internal-error
"univ-null, unknown target")))) "univ-null, unknown target"))))


(define (undefined? obj)
(eq? obj 'undefined))

(define (univ-undefined ctx)
(case (target-name (ctx-target ctx))

((js)
(gen "undefined"))

((python)
(gen "None"))

((ruby)
(gen "nil"))

((php) ;TODO: complete
(gen ""))

(else
(compiler-internal-error
"univ-undefined, unknown target"))))

(define (univ-list ctx obj) ;obj is a non-null list (define (univ-list ctx obj) ;obj is a non-null list


(define (make-list n elt) (define (make-list n elt)
Expand Down
2 changes: 1 addition & 1 deletion include/stamp.h
Expand Up @@ -3,4 +3,4 @@
*/ */


#define ___STAMP_YMD 20120810 #define ___STAMP_YMD 20120810
#define ___STAMP_HMS 143522 #define ___STAMP_HMS 152933

0 comments on commit 561beca

Please sign in to comment.