Skip to content

Commit

Permalink
FIX: properly implemented List_Func_Types function
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Sep 10, 2023
1 parent 6bbb04f commit 54bb9d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 33 deletions.
21 changes: 6 additions & 15 deletions src/core/c-function.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,14 @@
**
***********************************************************************/
{
REBSER *block;
REBSER *words = VAL_FUNC_WORDS(func);
REBCNT n;
REBVAL *value;
REBVAL *word;

block = Make_Block(SERIES_TAIL(words));
word = BLK_SKIP(words, 1);
REBVAL *val;
REBSER *types = VAL_FUNC_ARGS(func);

for (n = 1; n < SERIES_TAIL(words); word++, n++) {
value = Append_Value(block);
VAL_SET(value, VAL_TYPE(word));
VAL_WORD_SYM(value) = VAL_BIND_SYM(word);
UNBIND(value);
types = Copy_Block(types, 1);
for (val = BLK_HEAD(types); NOT_END(val); val++) {
SET_TYPE(val, REB_TYPESET);
}

return block;
return types;
}


Expand Down
19 changes: 1 addition & 18 deletions src/core/t-function.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,6 @@ static REBOOL Same_Func(REBVAL *val, REBVAL *arg)
return -1;
}


/***********************************************************************
**
*/ REBSER *As_Typesets(REBSER *types)
/*
***********************************************************************/
{
REBVAL *val;

types = Copy_Block(types, 1);
for (val = BLK_HEAD(types); NOT_END(val); val++) {
SET_TYPE(val, REB_TYPESET);
}
return types;
}


/***********************************************************************
**
*/ REBFLG MT_Function(REBVAL *out, REBVAL *data, REBCNT type)
Expand Down Expand Up @@ -145,7 +128,7 @@ static REBOOL Same_Func(REBVAL *val, REBVAL *arg)
Unbind_Block(VAL_BLK(value), TRUE);
break;
case OF_TYPES:
Set_Block(value, As_Typesets(VAL_FUNC_ARGS(value)));
Set_Block(value, List_Func_Types(value));
break;
case OF_TITLE:
arg = BLK_HEAD(VAL_FUNC_SPEC(value));
Expand Down

0 comments on commit 54bb9d9

Please sign in to comment.