seanjensengrey / mosh-scheme

Automatically exported from code.google.com/p/mosh-scheme
Other
0 stars 0 forks source link

Example of (mosh concurrent) raises an error #241

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run following

(import (rnrs) (mosh concurrent))
(let ([pid (spawn (lambda (x) (display x)) 'hello '((rnrs)))])
   (join! pid))

What is the expected output? What do you see instead?
I believe it should print 'hello

 Condition components:
 1. &who             who: process-exit
 2. &message         message: "unbound identifier"
 3. &undefined

 Exception:
     error in raise: returned from non-continuable exception

 Stack trace:
    1. throw: <subr>
    2. (raise c):  baselib.scm:943
    3. (syntax-type e r):  psyntax.scm:10
    4. (syntax-type e r):  psyntax.scm:10
    5. (chi-expr e r mr):  psyntax.scm:10
    6. (chi-expr* e* r mr):  psyntax.scm:10
    7. (lambda (x x*) ...):  psyntax.scm:10
    8. (lambda (e0 e1 e2) ...):  psyntax.scm:10
    9. (chi-expr* e* r mr):  psyntax.scm:10
    10. (lambda (uy1f06 uy1f08 uy1f0a uy1f0c uy1f0e uy1f10 uy1f12 uy1f14) ...):  psyntax.scm:10
    11. (lambda (x*) ...):  psyntax.scm:10
    12. (lambda (x*) ...):  psyntax.scm:10
    13. (lambda (fmls b b*) ...):  psyntax.scm:10
    14. (chi-expr* e* r mr):  psyntax.scm:10
    15. (lambda (rator rands) ...):  psyntax.scm:10
    16. (lambda (rator rands) ...):  psyntax.scm:10
    17. (chi-expr* e* r mr):  psyntax.scm:10
    18. (lambda (uy1f06 uy1f08 uy1f0a uy1f0c uy1f0e uy1f10 uy1f12 uy1f14) ...):  psyntax.scm:10
    19. (lambda (x*) ...):  psyntax.scm:10
    20. (lambda (x*) ...):  psyntax.scm:10
      ... (more stack dump truncated)

If I run it on NMosh then 
 Exception:
    error in raise(NMOSH): unhandled exception has occurred (and (nmosh startup) was not loaded)

#<type:condition(#<#<type:record-type-descriptor&who 
#<type:record-type-descriptor&condition #f &conidion-uid #f #f () > &who-uid #f 
#f ((#f . who)) >invalid reference > #<#<type:record-type-descriptor&message 
#<type:record-type-descriptor&condition #f &conidion-uid #f #f () > &me ...

 Stack trace:
    1. throw: <subr>
    2. (&operator-binding~1d!svp0~4776 &t~1d!svp0~12324): <unknown location>
    3. (&operator-binding~1d!svp0~4776 &t~1d!svp0~12324): <unknown location>
    4. (&head-expand~1d!svp0~4775 &t~1d!svp0~12335): <unknown location>
    5. (&head-expand~1d!svp0~4775 &t~1d!svp0~12335): <unknown location>
    6. (&emit~1d!svp0~10716): <unknown location>
    7. (&scan-sequence~1d!svp0~4798 &body-type~1d!svp0~10687 &make-map~1d!svp0~10688 &body-forms~1d!svp0~10689 &k~1d!svp0~10690): <unknown location>
    8. (&scan-sequence~1d!svp0~4798 &body-type~1d!svp0~10687 &make-map~1d!svp0~10688 &body-forms~1d!svp0~10689 &k~1d!svp0~10690): <unknown location>
    9. (&expand~1d!svp0~4774 &t~1d!svp0~12373): <unknown location>
    10. (&expand~1d!svp0~4774 &t~1d!svp0~12373): <unknown location>
    11. (&expand-if~1d!svp0~4779 &exp~1d!svp0~12121): <unknown location>
    12. (&expand-if~1d!svp0~4779 &exp~1d!svp0~12121): <unknown location>
    13. (&expand~1d!svp0~4774 &t~1d!svp0~12373): <unknown location>
    14. (&expand~1d!svp0~4774 &t~1d!svp0~12373): <unknown location>
    15. (lambda &form~1d!svp0~10936): <unknown location>
    16. (lambda &form~1d!svp0~10936): <unknown location>
    17. (map-1 proc lst):  baselib.scm:99
    18. (&scan-loop~1d!svp0~10695 &ws~1d!svp0~10712 &forms~1d!svp0~10713 &syntax-defs~1d!svp0~10714 &bound-variables~1d!svp0~10715): <unknown location>
    19. (&scan-loop~1d!svp0~10695 &ws~1d!svp0~10712 &forms~1d!svp0~10713 &syntax-defs~1d!svp0~10714 &bound-variables~1d!svp0~10715): <unknown location>
    20. (&scan-sequence~1d!svp0~4798 &body-type~1d!svp0~10687 &make-map~1d!svp0~10688 &body-forms~1d!svp0~10689 &k~1d!svp0~10690): <unknown location>
      ... (more stack dump truncated)

What version of the product are you using? On what operating system?
% mosh -V
Mosh R6RS scheme interpreter, version 0.2.7 (mosh-0.2.7 Tue, 14 Jun 2011 
07:00:31 +0900)

Please provide any additional information below.

Original issue reported on code.google.com by ktakash...@gmail.com on 29 Sep 2014 at 7:35

GoogleCodeExporter commented 9 years ago
Thanks for the report. In (mosh concurrent), every spawned process will require 
import of (mosh concurrent) library as a runtime. It seems by-design for now.

Fixed example in
https://github.com/okuoku/mosh/commit/a13f830d9d87f164629298b11fcce10fe5f18bb4

Original comment by oku...@gmail.com on 29 Sep 2014 at 10:44