Hi Bahman.
"apply" is the standard way of doing what you're looking for.
Cheers.
-Patrick
On Mon, Jan 5, 2015 at 10:25 AM, Bahman Movaqar wrote:
> Happy 2015 CHICKEN'ers!
>
> I have a procedure which accepts a variable number of lists as the
> arguments:
>
> (define (foobar . lists) ...)
>
On Wed, May 29, 2013 at 12:25 PM, Michele La Monaca <
mikele.chic...@lamonaca.net> wrote:
> On Wed, May 29, 2013 at 3:53 PM, Patrick Li
> wrote:
> > If I understand the OP correctly, he wants let* to imitate this macro.
> >
> > (define-syntax named-let*
> >
If I understand the OP correctly, he wants let* to imitate this macro.
(define-syntax named-let*
(syntax-rules ()
((named-let* name ((var val) ...)
body ...)
(let* ((var val) ...)
(let name ((var var) ...)
body ...)
-Patrick
On Wed, May 29, 2013 at 5:47
Hi George!
I can attest that writing your own scheme interpreter is fun and
educational. I've had success trying out language design ideas with
interpreters. I implemented a very simple heap-based interpreter, and tried
out a similar idea to yours with no problem (but I was using environments as
c some-more-args)
(do-that a b c some-more-args)
(do-other a b c some-more-args))
The dot trick doesn't work in this circumstance.
-Patrick
On Sun, Mar 20, 2011 at 10:36 PM, Thomas Chust wrote:
> 2011/3/21 Patrick Li :
> > [...]
> > I'm trying to write a
Hello everyone,
I'm trying to write the following macro using the syntax-rules system, and
got stuck trying to figure out the ellipsis. Would someone mind giving me a
hand with this? I really appreciate it.
I'm trying to write a macro that will tranform:
(temp (a b c) do-this do-that do-other)
i
Hello everyone,
I'm just debugging some software with display statements, except that I am
using some cyclic data structures.
If I use (display my-data-structure) on a cyclic structure, it just floods
the screen and crashes the program.
Is there an existing cycle-detecting pretty-printer for Chic
Thanks Peter. That's perfectly good enough. As long as I'm not repeating
myself and it's transparent to the user, I can live with it. You've been
very helpful.
-Patrick
On Sat, Feb 12, 2011 at 4:51 PM, Peter Bex wrote:
> On Sat, Feb 12, 2011 at 04:35:23PM -0500, Patr
Hello everyone,
I'm creating a module that exports two things, a macro and a function. The
definition of the macro happens to require the use of the function. I am
having problems creating this module. The defined macro cannot access the
function.
--Example
d-all bound-symbols (expand
expression)
expression))
;;Macroexpand-All
(define (macroexpand-all expression)
(-macroexpand-all '() expression))
On Sat, Feb 12, 2011 at 2:08 PM, Patrick Li wrote:
> Thanks for the help! I upgraded to 4.6.0 and everything's fine now.
> -Patrick
&
Thanks for the help! I upgraded to 4.6.0 and everything's fine now.
-Patrick
On Sat, Feb 12, 2011 at 12:55 PM, Peter Bex wrote:
> On Sat, Feb 12, 2011 at 12:18:30PM -0500, Patrick Li wrote:
> > Ah I'm using Chicken 4.4.0.
> > I'm a beginner to Chicken and just typ
Ah I'm using Chicken 4.4.0.
I'm a beginner to Chicken and just typed "port install chicken" into my
MacOSX terminal.
I'll figure out how to upgrade Chicken.
-Patrick
On Sat, Feb 12, 2011 at 12:04 PM, Peter Bex wrote:
> On Sat, Feb 12, 2011 at 11:52:40AM -0500, Pa
>
> After full expansion, you should get ##core#lambda, which is the "core"
> lambda.
>
I didn't understand what you mean by this part. How do I perform a "full
expansion"?
eg.
(define-syntax mymacro (syntax-rules () ((mymacro) (lambda () 3
(expand '(mymacro))
=> (lambda1020 () 3)
(expand (
Thanks for the help Felix!
There's one more question I stumbled upon actually. Do you know of some way
I can tell if a symbol *actually* refers to lambda or let?
eg. after some macro expansions, a form might look like (lambda89 (x y) body
...)
where lambda89 is equivalent to lambda.
Given a symb
Thanks for the help.
The module workaround will work fine for what I'm doing!
-Patrick
On Sat, Feb 12, 2011 at 5:36 AM, Felix <
fe...@call-with-current-continuation.org> wrote:
> >
> > There may be a shorter way involving begin-for-syntax or something.
> >
>
> (begin-for-syntax (define-syntax .
Hello,
I'm working with explicit renaming macros, and I'm having a lot of trouble
using macros within them.
(define-syntax say-hi
(syntax-rules ()
((say-hi) (display "Hello!"
(define-syntax my-renaming-macro
(lambda (expression rename comparison)
(say-hi) <-- Attempt to call pred
Great. Thanks for that tip! I think I will try and figure it out.
As long as I can figure out what the core binding-introducing forms are, I
think I can do it.
-Patrick
On Fri, Feb 11, 2011 at 2:56 PM, Peter Bex wrote:
> On Fri, Feb 11, 2011 at 02:46:58PM -0500, Patrick Li wrote:
> >
anyone know which forms introduce new bindings? How can I check this
up?
Thank you very much.
-Patrick
On Fri, Feb 11, 2011 at 12:15 PM, Patrick Li wrote:
> No I didn't.
> Thank you. I will check that out!
>
>
> On Fri, Feb 11, 2011 at 11:42 AM, Christian Kellermann <
> c
Hello everyone,
I'm trying to write a simple macroexpand-all function (a function to
recursively macroexpand all subforms in a form until there are absolutely no
macros left in the form), and realized that my naive implementation has a
serious bug in it, namely that it doesn't keep track of local
No I didn't.
Thank you. I will check that out!
On Fri, Feb 11, 2011 at 11:42 AM, Christian Kellermann
wrote:
> * Patrick Li [110211 17:20]:
> > Hello everyone,
> >
> > I'm trying to write a simple macroexpand-all function (a function to
> > recursively mac
Hello,
I am new to Chicken scheme and have just installed it using MacPorts.
I opened csi, and am having trouble finding macroexpand, or macroexpand-1.
I found some older posts that show that other members aren't having any
trouble.
Is there something that I am forgetting?
Thank you very much
21 matches
Mail list logo