
Explore Array Notation and Variable Assignment in Programming
Dive into the world of array notation and programmatic variable assignment with a series of detailed examples and code snippets demonstrating various sequences, ranges, and parameter namespaces. Learn how to manipulate data structures efficiently in your programming projects.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Fun with array notation and programmatic variable assignment Ad m Brudzewsky
Array Notation? [ 'a' 'b' ] ( 'eh' 'bee' ) ( a: 'eh' b: 'bee' ) ['a' 'b'] () Fun with array notation and programmatic variable assignment 1
Traditional code seq Range(from step to) seq from,from+step step to-from Range 10 2 18 10 12 14 16 18 Fun with array notation and programmatic variable assignment 2
Traditional code seq Range args;from;step;to :Select args :Case 3 (from step to) args :Case 2 (from step to) 1( ,1, )args :Case 1 (from step to) 0 1,args :EndSelect seq from,from+step step to-from Fun with array notation and programmatic variable assignment 3
Traditional code seq Range args;from;step;to (from step to) (58 args,0 1)[41 12 58] seq from,from+step step to-from Fun with array notation and programmatic variable assignment 4
Traditional code seq Range args;from;step;to (from step to) (58 args,0 1)[41 12 58] seq from,from+step step to-from Range 10 18 10 11 12 13 14 15 16 17 18 Fun with array notation and programmatic variable assignment 5
Parameter namespace argument seq Range params;from;step;to (from step) 0 1 THIS NS params seq from,from+step step to-from p NS p.from 10 p.to 18 Range p 10 11 12 13 14 15 16 17 18 Fun with array notation and programmatic variable assignment 6
Parameter namespace argument seq Range params;from;step;to (from step) 0 1 THIS NS params seq from,from+step step to-from p (from:10 to:18) Range p 10 11 12 13 14 15 16 17 18 Fun with array notation and programmatic variable assignment 7
Parameter namespace argument seq Range params;from;step;to (from step) 0 1 THIS NS params seq from,from+step step to-from Range(from:10 to:18) 10 11 12 13 14 15 16 17 18 Fun with array notation and programmatic variable assignment 8
Parameter namespace argument seq Range params;from;step;to THIS NS(from:0 step:1)params seq from,from+step step to-from Range(from:10 to:18) 10 11 12 13 14 15 16 17 18 Fun with array notation and programmatic variable assignment 9
Parameter namespace argument seq Range params ns NS(from:0 step:1)params seq ns.(from,from+step step to-from) Range(from:10 to:18) 10 11 12 13 14 15 16 17 18 Fun with array notation and programmatic variable assignment 10
Parameter namespace argument seq Range params ns (from:0 step:1) NS params seq ns.(from,from+step step to-from) Range(from:10 to:18) 10 11 12 13 14 15 16 17 18 Fun with array notation and programmatic variable assignment 11
Parameter namespace argument seq Range params seq ((from:0 step:1) NS params).(from,from+step Range(from:10 to:18) 10 11 12 13 14 15 16 17 18 Fun with array notation and programmatic variable assignment 12
Parameter namespace argument seq Range params seq (( from:0 step:1 ) NS params).(from,from+step step to-from) Range(from:10 to:18) 10 11 12 13 14 15 16 17 18 Fun with array notation and programmatic variable assignment 13
Parameter namespace argument seq Range params seq (( from:0 step:1 ) NS params).(from,from+step step to-from) Range(from:10 to:18) 10 11 12 13 14 15 16 17 18 Fun with array notation and programmatic variable assignment 14
Parameter namespace argument seq Range params seq (( from:0 step:1 must be positive ) NS params).(from,from+step step to-from) Range(from:10 to:18) 10 11 12 13 14 15 16 17 18 Fun with array notation and programmatic variable assignment 15
Parameter namespace argument Range {(( from:0 step:1 must be positive ) NS ).(from,from+step step to-from)} Range(from:10 to:18) 10 11 12 13 14 15 16 17 18 Fun with array notation and programmatic variable assignment 16
Programmatic assignment? 'ns1' NS 'v1' 'v2' ns1 NS 'v1' 'v2' NS ns2 NS ns2 ns3 ns4 {ns ,' '}/ nv1 nv2 ns VSET nv1 nv2 ns VSET( names)vals names{ns ,' '} vals () VSET Fun with array notation and programmatic variable assignment 17
Programmatic retrieval vals ns names vals ns VGET names nvs { ( )} NL 2 nvs VGET 2 (names vals) { ( )} NL 2 (names vals) VGET 2 Fun with array notation and programmatic variable assignment 18
Import to namespace 200 NGET'/d/aplde2025a/people.csv' first,last,sex,dob,address,city,country Uriab,Morris,M,20230512,"23, 14th Str",Jingdezhen,China Martha,Mitchell,F,20131129,"473, 27th Av",Lyon,France Lilah,Scott,F,20110527,"3483, 73rd Av",Northavon,U Fun with array notation and programmatic variable assignment 19
Import to namespace ( table cols) CSV csvFile 1 table[; cols 'last' 'first'] table[; cols 'country'] 'Germany' Barnes Idena Cooper Clyde Fun with array notation and programmatic variable assignment 20
Import to namespace ( vals cols) CSV 2 csvFile 1 VSET( cols) vals (last, first) country 'Germany' Barnes Idena Cooper Clyde Fun with array notation and programmatic variable assignment 21
Import to namespace { VSET( ) }/ CSV 2 csvFile 1 (last, first) country 'Germany' Barnes Idena Cooper Clyde Fun with array notation and programmatic variable assignment 22
Import to namespace db {() VSET( ) }/ CSV 2 csvFile 1 db.((last, first) country 'Germany') Barnes Idena Cooper Clyde Fun with array notation and programmatic variable assignment 23
Import to namespace db {() VSET( ) }/ CSV 2 csvFile 1 Where { () VSET / @2 VGET 2} db Where db.country 'Germany' #.[Namespace] Fun with array notation and programmatic variable assignment 24
Import to namespace db {() VSET( ) }/ CSV 2 csvFile 1 Where { () VSET / @2 VGET 2} View { {( ) }/ VGET 2} View db Where db.country 'Germany' address city country dob first last sex 38, Linda Dr, Suite 209 Bochum Germany 20200617 Idena Barnes F 203, Mandel Av Pforzheim Germany 20080113 Clyde Cooper M Fun with array notation and programmatic variable assignment 25
Programmatic retrieval values ns names values ns VGET names values ns VGET nameMat name_value_pairs ns VGET 2 (nameMat values) ns VGET 2 Fun with array notation and programmatic variable assignment 26
Default values values ns names values ns VGET (name1 val1) (name2 val2) values ns VGET nameMat values Fun with array notation and programmatic variable assignment 27
Parameter namespace argument seq Range params;from;step;to THIS NS(from:0 step:1)params seq from,from+step step to-from Range(from:10 to:18) 10 11 12 13 14 15 16 17 18 Fun with array notation and programmatic variable assignment 28
Default values seq Range params;from;step;to (from step to) params VGET( 'from' 0 'step' 1 'to' ) seq from,from+step step to-from Fun with array notation and programmatic variable assignment 29
Default values seq Range params;from;step;to (from step to) params VGET('from' 0 'step' seq from,from+step step to-from Fun with array notation and programmatic variable assignment 30
Default values seq Range params;from;step;to :Trap 0 (from step to) params VGET('from' 0 'step' seq from,from+step step to-from :Else SIGNAL 2 VGET DMX. NS'EN' 'EM' 'Message' :EndTrap Fun with array notation and programmatic variable assignment 31
Default values seq {debug}Range params;from;step;to :Trap 0 VGET 'debug' 0 (from step to) params VGET('from' 0 'step' seq from,from+step step to-from :Else SIGNAL 2 VGET DMX. NS'EN' 'EM' 'Message' :EndTrap Fun with array notation and programmatic variable assignment 32
Default values seq {debug}Range params;from;step;to :Trap VGET 'debug' 0 (from step to) params VGET('from' 0 'step' seq from,from+step step to-from :Else SIGNAL 2 VGET DMX. NS'EN' 'EM' 'Message' :EndTrap Fun with array notation and programmatic variable assignment 33
Summary Matrix, Vector: Namespace: Merge Namespace: ns1 NS ns2 NS ns1 ns2 Value Get: VGET names VGET nameMat VGET 2 VGET 2 VGET nv1 nv2 VGET nameMat values Value Set: VSET nv1 nv2 VSET nameMat values ['a' 'b'] ('eh' 'bee') (a:'eh' b:'bee') () Fun with array notation and programmatic variable assignment 34
Summary Matrix, Vector: Namespace: Merge Namespace: ns1 NS ns2 NS ns1 ns2 Value Get: VGET names VGET nameMat VGET 2 VGET 2 VGET nv1 nv2 VGET nameMat values Value Set: VSET nv1 nv2 VSET nameMat values ['a' 'b'] ('eh' 'bee') (a:'eh' b:'bee') () Fun with array notation and programmatic variable assignment 35