Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Davide Carpi  
#1 Posted : 08 July 2012 03:49:08(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Hi,

I found this bug defining user functions with IsString()

The issue disappear using IsString inside line()


regards,

w3b5urf3r

Edited by moderator 19 January 2016 16:44:41(UTC)  | Reason: edit for attach migration tests

File Attachment(s):
IsString_bug.sm (13kb) downloaded 28 time(s).
Davide Carpi attached the following image(s):
IsString (debug).PNG
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Stuart Bruff  
#2 Posted : 09 July 2012 09:40:55(UTC)
Stuart Bruff

Rank: Newbie

Groups: Registered
Joined: 16/06/2012(UTC)
Posts: 7
United Kingdom
Location: Home Counties

Originally Posted by: w3b5urf3r_reloaded Go to Quoted Post
Hi,

I found this bug defining user functions with IsString()

The issue disappear using IsString inside line()


regards,

w3b5urf3r



I'm not sure whether this is a bug or a delayed-evaluation 'feature' of using/not-using the program line. I raised a similar question about a month ago ...

Originally Posted by: Stuart Bruff Go to Quoted Post
Hello,

How is the equality (ctl-=) operator supposed to work? I get ([1]=1)=1 but ([1])=2; the latter I expect, but I am surprised that a matrix is equal to a scalar, even though it is just a single element matrix.

Is there a way of programmatically distinguishing between a scalar and an array? I know there's no IsScalar or IsArray function. I've seen the workaround for using num2str & mat and I've written a function

IsArray(x):=
|n:=findstr(num2str(x),"mat" )
|n<>-1

(why doesn't IsArray(x):=findstr(num2str(x),"mat" )<>-1 work?)

, but this would appear to impose quite an evaluation overhead for large matrices. I was hoping to use x=stack(x) to check if x was an array, hence the purpose of my original question.

Stuart
Offline Andrey Ivashov  
#3 Posted : 29 July 2012 21:55:10(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Thank you! Fixed.

Regards.
Andrey Ivashov attached the following image(s):
isString_fixed.png
thanks 2 users thanked Andrey Ivashov for this useful post.
on 30/07/2012(UTC),  on 30/07/2012(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.