Skip to content

Commit 67c2c05

Browse files
committed
patch 7.4.1688
Problem: MzScheme does not support partial. Solution: Add minimal partial support. (Ken Takata)
1 parent bdf0bda commit 67c2c05

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/if_mzsch.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3109,6 +3109,7 @@ vim_to_mzscheme_impl(typval_T *vim_value, int depth, Scheme_Hash_Table *visited)
31093109
MZ_GC_VAR_IN_REG(0, funcname);
31103110
MZ_GC_REG();
31113111

3112+
/* FIXME: func_ref() and func_unref() are needed. */
31123113
funcname = scheme_make_byte_string((char *)vim_value->vval.v_string);
31133114
MZ_GC_CHECK();
31143115
result = scheme_make_closed_prim_w_arity(vim_funcref, funcname,
@@ -3117,6 +3118,30 @@ vim_to_mzscheme_impl(typval_T *vim_value, int depth, Scheme_Hash_Table *visited)
31173118

31183119
MZ_GC_UNREG();
31193120
}
3121+
else if (vim_value->v_type == VAR_PARTIAL)
3122+
{
3123+
if (vim_value->vval.v_partial == NULL)
3124+
result = scheme_null;
3125+
else
3126+
{
3127+
Scheme_Object *funcname = NULL;
3128+
3129+
MZ_GC_DECL_REG(1);
3130+
MZ_GC_VAR_IN_REG(0, funcname);
3131+
MZ_GC_REG();
3132+
3133+
/* FIXME: func_ref() and func_unref() are needed. */
3134+
/* TODO: Support pt_dict and pt_argv. */
3135+
funcname = scheme_make_byte_string(
3136+
(char *)vim_value->vval.v_partial->pt_name);
3137+
MZ_GC_CHECK();
3138+
result = scheme_make_closed_prim_w_arity(vim_funcref, funcname,
3139+
(const char *)BYTE_STRING_VALUE(funcname), 0, -1);
3140+
MZ_GC_CHECK();
3141+
3142+
MZ_GC_UNREG();
3143+
}
3144+
}
31203145
else if (vim_value->v_type == VAR_SPECIAL)
31213146
{
31223147
if (vim_value->vval.v_number <= VVAL_TRUE)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ static char *(features[]) =
748748

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1688,
751753
/**/
752754
1687,
753755
/**/

0 commit comments

Comments
 (0)