Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to capture output of initial .postln in Routines and tasks #70

Closed
tatecarson opened this issue Jul 6, 2016 · 7 comments
Closed
Labels

Comments

@tatecarson
Copy link

tatecarson commented Jul 6, 2016

{"hi".postln; 1.wait; "hello".postln}.fork

This code, only in atom, returns hello, instead of hi and then hello. Any idea why? I'm trying to schedule other processes and not sure why it isn't working.

Tdef does work as expected but not task or routine.

Thanks.

@tatecarson
Copy link
Author

Also, class and method lookup isn't working for anything from the default library. Not sure if that's related. This has changed since the atom-sc update.

@crucialfelix
Copy link
Owner

Confirmed. If you turn on debug in the settings then it posts the stdin/stdout traffic:

debug   
SUPERCOLLIDERJS:f8c96e50-433f-11e6-8f4d-5d1519826968:CAPTURE:START


SUPERCOLLIDERJS:f8c96e50-433f-11e6-8f4d-5d1519826968:CAPTURE:END

SUPERCOLLIDERJS:f8c96e50-433f-11e6-8f4d-5d1519826968:START:Result
SUPERCOLLIDERJS:f8c96e50-433f-11e6-8f4d-5d1519826968:CHUNK:"a Routine"
SUPERCOLLIDERJS:f8c96e50-433f-11e6-8f4d-5d1519826968:END:Result
SUPERCOLLIDERJS.interpreted
-> 
hi

/Users/crucial/supercolliderjs/lib/utils/logger.js:105 debug   hello

So capture is somehow not enabled for that first hi.

@crucialfelix
Copy link
Owner

Is class/method lookup working for non-default library items ?

Does your project have SCClassLibrary added like this:

screen shot 2016-07-06 at 08 11 53

and do you have a .tags and/or .tags1 file in your project root ? It needs to stick it somewhere so you do need to have a project not just open atom and work with an unsaved file.

@crucialfelix crucialfelix changed the title Routines and tasks are ignoring the first element Failing to capture output of initial .postln in Routines and tasks Jul 6, 2016
@tatecarson
Copy link
Author

Class method lookup works for Extensions and quarks. My tree looks like that..project folder SCClassLibrary Extensions then Quarks. There's a .tags and .tags1 in my project folder. When I turn on debug nothing seems to happen. Is that in the post window or somewhere else?

@crucialfelix
Copy link
Owner

crucialfelix commented Jul 6, 2016

debug posts to the console: option-command-i

screen shot 2016-07-06 at 09 35 51

@crucialfelix
Copy link
Owner

try Rebuild Tags and look in the console to see if atom-ctags is posting any errors.

@crucialfelix
Copy link
Owner

fixed.

I understand now what happens. The state parser (sclang-io) is capturing the output of the evaluation. The result is "a Routine" - but in the same STDOUT blurp sclang forks and posts "hi" before it returns "a Routine"

Thanks very much for the clear and reproducible report !

I do unit tests with these to make sure the state parser is solid:

https://github.com/crucialfelix/supercolliderjs/blob/develop/src/lang/internals/__tests__/fixtures/routine-postln.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants