Hello BP
seq1 := a, b, c
seq1[ 0 ] [↵] returns a
seq1[[ 1 ]] [↵] returns a
seq1[ 1 ] [↵] returns b
seq1[ 0..1 ] [↵] returns (a,b)
seq1[[1..2]] [↵] returns "invalid dimension" Why?
seq1[:] [↵] returns (a,b,c)
seq1[ : ] [↵] returns (a,b,c)[undef] Why?
session Xcas, sequences
seq1 := (a, b, c); seq1[[1..2]]
Modérateur : xcasadmin
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: seq1 := (a, b, c); seq1[[1..2]]
Double [[]] are not supported with ..compsystems a écrit : ↑dim. janv. 06, 2019 9:19 pmseq1[[1..2]] [↵] returns "invalid dimension" Why?
[:] is recognized, but that's all. There is no reason to add spaces!seq1[ : ] [↵] returns (a,b,c)[undef] Why?
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: seq1 := (a, b, c); seq1[[1..2]]
...with sequencesparisse a écrit : ↑lun. janv. 07, 2019 7:10 pmDouble [[]] are not supported with ..compsystems a écrit : ↑dim. janv. 06, 2019 9:19 pmseq1[[1..2]] [↵] returns "invalid dimension" Why?
[:] is recognized, but that's all. There is no reason to add spaces!seq1[ : ] [↵] returns (a,b,c)[undef] Why?
there are algorithms in which sometimes it is better to index in 0 and others in 1, this avoids addition and subtraction of variables, a great idea to use [] or [[ ]] for that purpose.
The use of spaces is intended to give greater readability to expressions, every book of all the sciences shows that after a comma is a space, an improvement in the future, it would be to show the expressions of output not together 1,2,3 but 1, 2, 3 and even the operators a+(b*c) => a + (b * c)
at least for a flag controlled by the user, that is to say who does not mind seeing everything together or who wants to see the separate expressions
Re: seq1 := (a, b, c); seq1[[1..2]]
I will add support for [[a..b]]
I will not change output. Anyway, I don't like the idea that spaces should be added before/after operators.
I will not change output. Anyway, I don't like the idea that spaces should be added before/after operators.