Relative Content

Tag Archive for scheme

Abstract List Functions in Racket/Scheme

I’m completely stuck on a problem to write a function that does NOT use recursion, locals, or lambda. Only abstract list functions can be used.
The function must input a list of positive integers, and output a list of integers that are strictly greater than 1.

What about LISP, if anything, makes it easier to implement macro systems?

I’m learning Scheme from the SICP and I’m getting the impression that a big part of what makes Scheme and, even more so, LISP special is the macro system. But, since macros are expanded at compile-time, why don’t people make equivalent macro systems for C/Python/Java/whatever? For example, one could bind the python command to expand-macros | python or whatever. The code would still be portable to people who don’t use the macro system, one would just expand the macros before publishing code. But I don’t know of anything like that except templates in C++/Haskell, which I gather aren’t really the same. What about LISP, if anything, makes it easier to implement macro systems?

What about LISP, if anything, makes it easier to implement macro systems?

I’m learning Scheme from the SICP and I’m getting the impression that a big part of what makes Scheme and, even more so, LISP special is the macro system. But, since macros are expanded at compile-time, why don’t people make equivalent macro systems for C/Python/Java/whatever? For example, one could bind the python command to expand-macros | python or whatever. The code would still be portable to people who don’t use the macro system, one would just expand the macros before publishing code. But I don’t know of anything like that except templates in C++/Haskell, which I gather aren’t really the same. What about LISP, if anything, makes it easier to implement macro systems?

What about LISP, if anything, makes it easier to implement macro systems?

I’m learning Scheme from the SICP and I’m getting the impression that a big part of what makes Scheme and, even more so, LISP special is the macro system. But, since macros are expanded at compile-time, why don’t people make equivalent macro systems for C/Python/Java/whatever? For example, one could bind the python command to expand-macros | python or whatever. The code would still be portable to people who don’t use the macro system, one would just expand the macros before publishing code. But I don’t know of anything like that except templates in C++/Haskell, which I gather aren’t really the same. What about LISP, if anything, makes it easier to implement macro systems?