Author Topic: LET Syntax  (Read 2020 times)

0 Members and 1 Guest are viewing this topic.

Charles Pegge

  • Guest
LET Syntax
« on: January 31, 2014, 01:14:59 PM »
Multi-Let has now implemented (posted about 4.5 hours ago)

http://www.oxygenbasic.org/forum/index.php?topic=749.0

Code: [Select]
'BY VALUE:

let a=1    'sys
let b=1.0 'double
let c="1" 'string


'BY VARIABLE:

let d=a   'sys
let e=c   'string


'BY TYPE:"

type vector single x,y,z

let v=vector : v.x=2 'vector
let w=v      :       'vector w.x=2


'BY FACTORY FUNCTION:

function vcreate(sys n) as vector*
return getmemory n*sizeof vector
end function

let u=vcreate(10)   'vector


'MULTI-LET:"

let a,b,c,d=pi               'double precision pies



Emil_halim

  • Guest
Re: LET Syntax
« Reply #1 on: February 01, 2014, 08:50:42 AM »


very nice that new feature.

does it use memory copying after declaration ?
 

Charles Pegge

  • Guest
Re: LET Syntax
« Reply #2 on: February 01, 2014, 09:59:57 AM »
Hi Emil,
It depends on the type of Let. Factory functions allocate memory and return a pointer, variables will normally assign by copying to direct local or static memory.

More details later.