The R Project SVN R

Rev

Rev 42307 | Rev 45667 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 42307 Rev 45446
Line 58... Line 58...
58
    SET_PRIMOFFSET(result, offset);
58
    SET_PRIMOFFSET(result, offset);
59
    return (result);
59
    return (result);
60
}
60
}
61
 
61
 
62
/* This is called by function() {}, where an invalid
62
/* This is called by function() {}, where an invalid
63
   body should be impossible. When called from 
63
   body should be impossible. When called from
64
   other places (eg do_asfunction) they 
64
   other places (eg do_asfunction) they
65
   should do this checking in advance */
65
   should do this checking in advance */
66
 
66
 
67
/*  mkCLOSXP - return a closure with formals f,  */
67
/*  mkCLOSXP - return a closure with formals f,  */
68
/*             body b, and environment rho       */
68
/*             body b, and environment rho       */
69
 
69
 
Line 77... Line 77...
77
 
77
 
78
#ifdef not_used_CheckFormals
78
#ifdef not_used_CheckFormals
79
    if(isList(formals))
79
    if(isList(formals))
80
	SET_FORMALS(c, formals);
80
	SET_FORMALS(c, formals);
81
    else
81
    else
82
        error(_("invalid formal arguments for \"function\""));
82
	error(_("invalid formal arguments for \"function\""));
83
#else
83
#else
84
    SET_FORMALS(c, formals);
84
    SET_FORMALS(c, formals);
85
#endif
85
#endif
86
    if(isList(body) || isLanguage(body) || isSymbol(body)
86
    if(isList(body) || isLanguage(body) || isSymbol(body)
87
       || isExpression(body) || isVector(body)
87
       || isExpression(body) || isVector(body)
Line 89... Line 89...
89
       || isByteCode(body)
89
       || isByteCode(body)
90
#endif
90
#endif
91
       )
91
       )
92
	SET_BODY(c, body);
92
	SET_BODY(c, body);
93
    else
93
    else
94
        error(_("invalid body argument for \"function\"\n\
94
	error(_("invalid body argument for \"function\"\n\
95
Should NEVER happen; please bug.report() [mkCLOSXP]"));
95
Should NEVER happen; please bug.report() [mkCLOSXP]"));
96
 
96
 
97
    if(rho == R_NilValue)
97
    if(rho == R_NilValue)
98
	SET_CLOENV(c, R_GlobalEnv);
98
	SET_CLOENV(c, R_GlobalEnv);
99
    else
99
    else
Line 113... Line 113...
113
    char *endp;
113
    char *endp;
114
    long val;
114
    long val;
115
 
115
 
116
    buf = CHAR(name);
116
    buf = CHAR(name);
117
    if( !strncmp(buf, "..", 2) && strlen(buf) > 2 ) {
117
    if( !strncmp(buf, "..", 2) && strlen(buf) > 2 ) {
118
        buf += 2;
118
	buf += 2;
119
	val = strtol(buf, &endp, 10);
119
	val = strtol(buf, &endp, 10);
120
        if( *endp != '\0')
120
	if( *endp != '\0')
121
	    return 0;
121
	    return 0;
122
	else
122
	else
123
	    return 1;
123
	    return 1;
124
    }
124
    }
125
    return 0;
125
    return 0;