public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* Query on using `stream-cons' with srfi-14
@ 2014-07-23 11:23 Kumar Appaiah
  2014-07-23 17:45 ` Per Bothner
  0 siblings, 1 reply; 5+ messages in thread
From: Kumar Appaiah @ 2014-07-23 11:23 UTC (permalink / raw)
  To: kawa

Hi.

I'm trying out the SICP examples on streams using kawa. I am currently
stuck on a stream example. The particular blurb of code is:

(define cons-stream stream-cons)
(define the-empty-stream stream-null)
(define (stream-enumerate-interval low high)
  (if (> low high)
      the-empty-stream
      (cons-stream
       low
       (stream-enumerate-interval (+ low 1) high))))

The full code can be found on this page:
https://gist.github.com/kumanna/94cb8bb130fed4805d21

Running this gives me the following error:
Argument  '#<macro stream-cons>' to 'apply-to-args' has wrong type (kawa.lang.Macro) (expected: procedure)
        at gnu.kawa.functions.ApplyToArgs.applyN(ApplyToArgs.java:165)
        at gnu.mapping.ProcedureN.apply3(ProcedureN.java:48)
        at atInteractiveLevel$21.streamEnumerateInterval(3-streams-1.scm:89)
        at atInteractiveLevel$21.streamEnumerateInterval(3-streams-1.scm:89)
        at atInteractiveLevel$21.streamEnumerateInterval(3-streams-1.scm:89)
        at atInteractiveLevel$21.streamEnumerateInterval(3-streams-1.scm:89)
        at atInteractiveLevel$21.streamEnumerateInterval(3-streams-1.scm:89)
        at atInteractiveLevel$21.streamEnumerateInterval(3-streams-1.scm:89)
        at atInteractiveLevel$21.streamEnumerateInterval(3-streams-1.scm:89)
        at atInteractiveLevel$21.streamEnumerateInterval(3-streams-1.scm:89)
        at atInteractiveLevel$21.streamEnumerateInterval(3-streams-1.scm:89)
        at atInteractiveLevel$21.streamEnumerateInterval(3-streams-1.scm:89)
        at atInteractiveLevel$21.apply2(3-streams-1.scm:84)
        at gnu.expr.ModuleMethod.apply2(ModuleMethod.java:198)
        at atInteractiveLevel$23.lambda1(3-streams-1.scm:98)
        at atInteractiveLevel$23.apply0(3-streams-1.scm:98)
        at gnu.expr.ModuleBody.applyN(ModuleBody.java:233)
        at gnu.expr.ModuleMethod.applyN(ModuleMethod.java:216)
        at gnu.kawa.functions.ApplyToArgs.applyN(ApplyToArgs.java:137)
        at gnu.mapping.ProcedureN.apply1(ProcedureN.java:31)
        at atInteractiveLevel$8.timeExecute(3-streams-1.scm:45)
        at atInteractiveLevel$8.apply1(3-streams-1.scm:43)
        at gnu.expr.ModuleMethod.apply1(ModuleMethod.java:192)
        at gnu.expr.ModuleMethod.apply(ModuleMethod.java:163)
        at gnu.mapping.CallContext.runUntilDone(CallContext.java:234)
        at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:373)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:210)
        at kawa.Shell.run(Shell.java:279)
        at kawa.Shell.runFile(Shell.java:482)
        at kawa.Shell.runFileOrClass(Shell.java:420)
        at kawa.repl.processArgs(repl.java:250)
        at kawa.repl.main(repl.java:850)

What am I doing wrong? Please let me know if I am not being clear.

Thanks.

Kumar
-- 
Kumar Appaiah

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-24  3:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23 11:23 Query on using `stream-cons' with srfi-14 Kumar Appaiah
2014-07-23 17:45 ` Per Bothner
2014-07-23 18:01   ` Jamison Hope
2014-07-24  3:42     ` Kumar Appaiah
2014-07-24  3:43   ` Kumar Appaiah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).