That is, when you call a function with >1 arity with only one argument, it should, instead of displaying an error, curry that argument and return the resulting function with
Sure, you just have to decide exact semantics for your language, and then implement your own loader which will translate your source files into the implementation language.
You could e.g. translate every user function call (f a b c ... z)
into (...(((f a) b) c)... z)
, and every (define (f a b c ... z) ...)
to (define f (lambda(a) (lambda(b) (lambda(c) (... (lambda(z) ...) ...)))))
on top of a Scheme, to have an auto-currying Scheme (that would forbid varargs functions of course).
You will also need to define your own primitives, turning the varargs functions like e.g. (+)
to binary, and turning their applications to using fold e.g. (+ 1 2 3 4)
==> (fold (+) (list 1 2 3 4) 0)
or something - or perhaps just making such calls as (+ 1 2 3 4)
illegal in your new language, expecting of its user to write fold
forms by themselves.
That's what I meant by "deciding ... semantics for your language".
The loader can be as simple as wrapping the file contents into a call to a macro - which you would then have to implement, as per your question.