On Tue, Jul 15, 2008 at 11:46 PM, Alejandro Jakubi <[EMAIL PROTECTED]> wrote:
>
> May be a bug or expected behavior, I do not know.
>
> I have pasted the example of "Tachyon 3D plotting" here:
> http://www.sagemath.org/doc/html/const/node19.html
> to a notebook input region in this way:
>
> ===
> sage: f = lambda t: (t,t^2,t^3)
> sage: t = Tachyon(camera_center=(5,0,4))
> sage: t.texture('t')
> sage: t.light((-20,-20,40), 0.2, (1,1,1))
> sage: t.parametric_plot(f,-5,5,'t',min_depth=6)
> t.show()
> ===
>
> The last line without the "sage:" string as it copied from the middle
> of a sentence.
>
> I have read somewhere that this "sage:" need not be removed when
> copying input (presumably it is removed by parsing). So I have though
> that it is indifferent whether it is there or not.
>
> But when executed within the notebook interface I do not get any
> output. Surprisingly, when pasted and executed in the console
> interface, it produces the plot (shown in a window).
>
> I have realized that adding "sage:" to the last line makes it work in
> the notebook:  the plot is shown below the input region.
>
> So, is this the expected behavior?

Yes this is expected behavior
The notebook parses whole *blocks* of input rather than individual lines,
so it can do some more sophisticated things.  Since one often wants to
paste in examples from docstrings that have explanations between them,
in the notebook one has the rule: "If any line starts with a prompt,
then *only* the lines that start with prompts are evaluated, and all
others are ignored."

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to