Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/runtime/c-libs/smlnj-runtime/record-concat.c
ViewVC logotype

Annotation of /sml/trunk/src/runtime/c-libs/smlnj-runtime/record-concat.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (view) (download) (as text)

1 : monnier 249 /* record-concat.c
2 :     *
3 :     * COPYRIGHT (c) 1998 Bell Labs, Lucent Technologies.
4 :     *
5 :     * Concatenation for records.
6 :     */
7 :    
8 :    
9 :     #include "ml-base.h"
10 :     #include "ml-values.h"
11 :     #include "ml-state.h"
12 :     #include "ml-objects.h"
13 :     #include "gc.h"
14 :     #include "cfun-proto-list.h"
15 :     #include "ml-c.h"
16 :    
17 :    
18 :    
19 :     /* _ml_RunT_recordconcat : (object * object) -> object
20 :     *
21 :     */
22 :     ml_val_t _ml_RunT_recordconcat (ml_state_t *msp, ml_val_t arg)
23 :     {
24 :     ml_val_t r1 = REC_SEL(arg,0);
25 :     ml_val_t r2 = REC_SEL(arg,1);
26 :    
27 :     if (r1 == ML_unit)
28 :     return r2;
29 :     else if (r2 == ML_unit)
30 :     return r1;
31 :     else {
32 :     ml_val_t res = RecordConcat (msp, r1, r2);
33 :    
34 :     if (res == ML_unit)
35 :     return RAISE_ERROR(msp, "recordconcat: not a record");
36 :     else
37 :     return res;
38 :     }
39 :    
40 :     } /* end of _ml_RunT_recordconcat */
41 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0