@@ -167,10 +167,39 @@ value_t fl_julia_scalar(fl_context_t *fl_ctx, value_t *args, uint32_t nargs)
167167 return fl_ctx -> F ;
168168}
169169
170+ static jl_value_t * scm_to_julia_ (fl_context_t * fl_ctx , value_t e , int expronly , jl_module_t * mod );
171+
172+ value_t fl_julia_syntax_depwarn (fl_context_t * fl_ctx , value_t * args , uint32_t nargs )
173+ {
174+ if (nargs < 1 )
175+ lerror (fl_ctx , fl_ctx -> ArgError , "julia-syntax-depwarn: too few arguments" );
176+ static jl_value_t * depwarn_func = NULL ;
177+ if (!depwarn_func && jl_base_module )
178+ depwarn_func = jl_get_global (jl_base_module , jl_symbol ("syntax_depwarn" ));
179+ if (!depwarn_func )
180+ return fl_ctx -> F ;
181+ value_t ret = fl_ctx -> T ;
182+ jl_value_t * * depwarn_args ;
183+ JL_GC_PUSHARGS (depwarn_args , nargs + 1 );
184+ JL_TRY {
185+ depwarn_args [0 ] = depwarn_func ;
186+ for (int i = 0 ; i < nargs ; ++ i )
187+ depwarn_args [i + 1 ] = scm_to_julia_ (fl_ctx , args [i ], 0 , NULL );
188+ jl_apply (depwarn_args , nargs + 1 );
189+ }
190+ JL_CATCH {
191+ // Ignore - julia side should handle exceptions for simplicity.
192+ ret = fl_ctx -> F ;
193+ }
194+ JL_GC_POP ();
195+ return ret ;
196+ }
197+
170198static const builtinspec_t julia_flisp_ast_ext [] = {
171199 { "defined-julia-global" , fl_defined_julia_global },
172200 { "current-julia-module-counter" , fl_current_module_counter },
173201 { "julia-scalar?" , fl_julia_scalar },
202+ { "julia-syntax-depwarn" , fl_julia_syntax_depwarn },
174203 { NULL , NULL }
175204};
176205
@@ -394,8 +423,6 @@ static jl_sym_t *scmsym_to_julia(fl_context_t *fl_ctx, value_t s)
394423 return jl_symbol (symbol_name (fl_ctx , s ));
395424}
396425
397- static jl_value_t * scm_to_julia_ (fl_context_t * fl_ctx , value_t e , int expronly , jl_module_t * mod );
398-
399426static jl_value_t * scm_to_julia (fl_context_t * fl_ctx , value_t e , int expronly , jl_module_t * mod )
400427{
401428 jl_value_t * v = NULL ;
0 commit comments