array->last()= Issue

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

array->last()= Issue

Justin Dennis-3
I can't believe I'm just discovering this, but in Lasso 9.2.3:

array->last += 'test'

...fails for lack of definition, while:

array->get(array->size) += 'test'

Works as expected. Is this a bug?

- Justin

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: array->last()= Issue

Jolle Carlestam-2
13 okt 2015 kl. 03:42 skrev Justin Dennis <[hidden email]>:

>
> I can't believe I'm just discovering this, but in Lasso 9.2.3:
>
> array->last += 'test'
>
> ...fails for lack of definition, while:
>
> array->get(array->size) += 'test'
>
> Works as expected. Is this a bug?

I suggest you use append instead of +=. The latter should be avoided in any case for string or bytes joining.

local(myarray = array('one', 'two'))

#myarray -> last -> append('test')

#myarray

-> array(one, twotest)

For reference
string += string is always a bad idea. It is considerably slower than string -> append(string).

HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: array->last()= Issue

Brad Lindsay
On October 13, 2015 at 1:26:20 AM, Jolle Carlestam ([hidden email]) wrote:

> 13 okt 2015 kl. 03:42 skrev Justin Dennis :
> >
> > I can't believe I'm just discovering this, but in Lasso 9.2.3:
> >
> > array->last += 'test'
> >
> > ...fails for lack of definition, while:
> >
> > array->get(array->size) += 'test'
> >
> > Works as expected. Is this a bug?
>  
> I suggest you use append instead of +=. The latter should be avoided in any case for string  
> or bytes joining.

Just to clarify, and I’m sure Jolle knows this, but this is not always true. If you don’t want to modify the original value (because you have references to it held in other variables or container types) then you don’t want to use append.

Example:

local(x) = "foo"
local(y) = #x

#x->append("bar")
#x // => foobar
#y // => foobar (oops! unexpected changes to #y!)

#x += "baz"
#x // => foobarbaz
#y // => foobar (not modified this time)


To answer Justin’s original question: If you could do it in 8, then it’s probably a compatibility bug, otherwise it’s probably a nice feature to add.


HTH,
Brad

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: array->last()= Issue

Jolle Carlestam-2
14 okt 2015 kl. 03:06 skrev Brad Lindsay <[hidden email]>:

>
>> I suggest you use append instead of +=. The latter should be avoided in any case for string  
>> or bytes joining.
>
> Just to clarify, and I’m sure Jolle knows this, but this is not always true. If you don’t want to modify the original value (because you have references to it held in other variables or container types) then you don’t want to use append.
>
> Example:
>
> local(x) = "foo"
> local(y) = #x
>
> #x->append("bar")
> #x // => foobar
> #y // => foobar (oops! unexpected changes to #y!)
>
> #x += "baz"
> #x // => foobarbaz
> #y // => foobar (not modified this time)

Good point, Brad.
I did know that, as should any developer using Lasso 9. It is an effect of Lasso 9s extensive use of references. A very good feature that is one of the reasons Lasso 9 is so fast.

The rest of my writing here is all about personal preference, other views on the matter are probably highly relevant.

I would not see #y // => foobar as an unexpected change. Since I’m aware of how Lasso 9 uses references.

If I wanted #y to be a reference to #x the I would do exactly as Brad describes and safely use #y -> append. In fact I would need to use append since += would destroy the reference. A behavior that can be equally unexpected.

If I didn’t want #y to be a reference to #x I would make sure that it wasn’t created as such to begin with.
local(y) = #x -> ascopy
or
local(y) = #x -> asstring
or whatever suits the need best.

In any case I stick with my statement earlier (remember, personal preference). I would never use += for string concatenation ever. If for no other reason that it is significantly slower. Might not be noticeable if only used once or twice. But if you put it into looping sections it will make a huge difference. As my fellow coder Frank can testify. He had some complex, looping code that he gained seconds on when he changed from += to -> append.

HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: array->last()= Issue

Justin Dennis-3
Thank you both for your insights on this. Learn something every day on
LassoTalk. -Justin

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: array->last()= Issue

Brad Lindsay
In reply to this post by Jolle Carlestam-2
On October 14, 2015 at 4:26:39 AM, Jolle Carlestam ([hidden email]) wrote:
> The rest of my writing here is all about personal preference, other views on the matter  
> are probably highly relevant.
>  
> ...
>  
> If I didn’t want #y to be a reference to #x I would make sure that it wasn’t created as such  
> to begin with.
> local(y) = #x -> ascopy

And my personal preference is the opposite — if I’m going to make changes to a string, and I don’t know if something else may reference it, I have the variable that’s going to be making changes make the copy. The reason for this is it’s consistent with locals defined by a method definition:

define mymethod(x::string) => {
   #x = #x->asCopy
   // ...
   #x->append(‘Frank’)
   // ...
}

I guess another way to put my philosophy: if you’re going to mutate something - you better own the only reference to it. (Insert caveat about general rules that may need to be occasionally broken.)

Brad

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Filemaker backups ??

Michael Benedict
Hello,

Filemaker and Lasso.

Can a Filemaker "backup" interfere with an Add action in Lasso. (8.6.3)
That is to say, prevents a new record from being created?

Thanks for your thoughts.

M


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: array->last()= Issue

decorior
In reply to this post by Brad Lindsay
This was something that Brad identified earlier to me with maps manipulation.

Lasso 9 does such a good of of isolating scope.

Deco

> On Oct 14, 2015, at 6:23 PM, Brad Lindsay <[hidden email]> wrote:
>
> On October 14, 2015 at 4:26:39 AM, Jolle Carlestam ([hidden email]) wrote:
>> The rest of my writing here is all about personal preference, other views on the matter  
>> are probably highly relevant.
>>
>> ...
>>
>> If I didn’t want #y to be a reference to #x I would make sure that it wasn’t created as such  
>> to begin with.
>> local(y) = #x -> ascopy
>
> And my personal preference is the opposite — if I’m going to make changes to a string, and I don’t know if something else may reference it, I have the variable that’s going to be making changes make the copy. The reason for this is it’s consistent with locals defined by a method definition:
>
> define mymethod(x::string) => {
>    #x = #x->asCopy
>    // ...
>    #x->append(‘Frank’)
>    // ...
> }
>
> I guess another way to put my philosophy: if you’re going to mutate something - you better own the only reference to it. (Insert caveat about general rules that may need to be occasionally broken.)
>
> Brad
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Filemaker backups ??

maxwellk2
In reply to this post by Michael Benedict
I have a 5+ GB FileMaker databases running under FMS13 (with SSD drives), which is scheduled to do hourly backups. I’ve never seen an Add action, or any other action, fail during a backup.

However, I have FMS’s "Verify backup integrity" turned off for these hourly backups. I only do one nightly backup with "Verify backup integrity" turned on. With large databases I have seen the backup integrity checks cause general performance issues and CWP/WPE requests start to get backlogged.

-Max



> On Oct 14, 2015, at 5:41 PM, Michael Benedict <[hidden email]> wrote:
>
> Hello,
>
> Filemaker and Lasso.
>
> Can a Filemaker "backup" interfere with an Add action in Lasso. (8.6.3)
> That is to say, prevents a new record from being created?
>
> Thanks for your thoughts.
>
> M
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

RE: Filemaker backups ??

Michael Benedict
Max,
Your tip surely improved the speed of the Backups.
Thanks.
Michael

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Maxwell Klein
Sent: Wednesday, October 14, 2015 7:10 PM
To: [hidden email]
Subject: Re: Filemaker backups ??

I have a 5+ GB FileMaker databases running under FMS13 (with SSD drives), which is scheduled to do hourly backups. I’ve never seen an Add action, or any other action, fail during a backup.

However, I have FMS’s "Verify backup integrity" turned off for these hourly backups. I only do one nightly backup with "Verify backup integrity" turned on. With large databases I have seen the backup integrity checks cause general performance issues and CWP/WPE requests start to get backlogged.

-Max



> On Oct 14, 2015, at 5:41 PM, Michael Benedict <[hidden email]> wrote:
>
> Hello,
>
> Filemaker and Lasso.
>
> Can a Filemaker "backup" interfere with an Add action in Lasso.
> (8.6.3) That is to say, prevents a new record from being created?
>
> Thanks for your thoughts.
>
> M
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to  the mailing
> list Lasso [hidden email] Official list archives available
> at http://www.lassotalk.com To unsubscribe, E-mail to:
> <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email] Official list archives available at http://www.lassotalk.com To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>