Login
Design Gallery (microblocks-compact — ≺a href=”/gp-crystal/ext/gpcr/gallery?tokens=blockly-zelos”≻view blockly-zelos≺/a≻)
Login

./std

require './std'
scale = 0.75
fontscale = 1.500
box wid 1.340 ht 0.340 with .nw at (0.035, -0.035) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.340 ht 0.340 with .nw at (0.000, 0.000) fill 0x7C83E6 color 0x7C83E6
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -0.022) fill 0xffffff color 0xffffff
line from (0.140, 0.000) to (0.140, -0.340) color white
line from (1.200, 0.000) to (1.200, -0.340) color white
text "require './std'" color white at (0.670, -0.170)

crystal source

require "./std"

json block

{
  "kind": "require",
  "name": "./std",
  "doc": null,
  "children": []
}

gallery_hat

shape: hat — event header with dome silhouette (start / message)

hat shape 1
scale = 0.75
fontscale = 1.500
box wid 1.057 ht 0.340 with .nw at (0.035, -0.455) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.057 ht 0.340 with .nw at (0.000, -0.420) fill 0xEC407A color 0xEC407A
ellipse wid 1.600 ht 0.340 at (0.800, -0.420) fill 0xEC407A color 0xEC407A
text "hat shape" color white at (0.529, -0.590)
box wid 0.240 ht 0.220 rad 0.110 at (0.907, -0.560) fill 0x334155 color 0x334155
text "1" at (0.907, -0.560) color 0xf8fafc

crystal source

@[GPCR::Primitive(shape: :hat, label: "hat shape", category: "Gallery")]
def gallery_hat
end

json block

{
  "kind": "primitive",
  "name": "gallery_hat",
  "doc": "shape: hat — event header with dome silhouette (start / message)",
  "label": "hat shape",
  "shape": "hat",
  "category": "Gallery",
  "returns": null,
  "children": []
}

gallery_command

shape: command — workhorse rectangle with stack tabs

command shape 2
scale = 0.75
fontscale = 1.500
box wid 1.588 ht 0.340 rad 0.035 with .nw at (0.035, -0.875) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.588 ht 0.340 rad 0.035 with .nw at (0.000, -0.840) fill 0xEC407A color 0xEC407A
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -0.863) fill 0xffffff color 0xffffff
text "command shape" color white at (0.794, -1.010)
box wid 0.240 ht 0.220 rad 0.110 at (1.438, -0.980) fill 0x334155 color 0x334155
text "2" at (1.438, -0.980) color 0xf8fafc

crystal source

@[GPCR::Primitive(shape: :command, label: "command shape", category: "Gallery")]
def gallery_command
end

json block

{
  "kind": "primitive",
  "name": "gallery_command",
  "doc": "shape: command — workhorse rectangle with stack tabs",
  "label": "command shape",
  "shape": "command",
  "category": "Gallery",
  "returns": null,
  "children": []
}

gallery_reporter

shape: reporter — oval carrying a computed value

reporter shape 3
scale = 0.75
fontscale = 1.500
box wid 1.431 ht 0.340 rad 0.170 with .nw at (0.035, -1.295) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.431 ht 0.340 rad 0.170 with .nw at (0.000, -1.260) fill 0xFF8C1A color 0xFF8C1A
text "reporter shape" color white at (0.716, -1.430)
box wid 0.240 ht 0.220 rad 0.110 at (1.281, -1.400) fill 0x334155 color 0x334155
text "3" at (1.281, -1.400) color 0xf8fafc

crystal source

@[GPCR::Primitive(shape: :reporter, label: "reporter shape", category: "Gallery", returns: :string)]
def gallery_reporter : String
  ""
end

json block

{
  "kind": "primitive",
  "name": "gallery_reporter",
  "doc": "shape: reporter — oval carrying a computed value",
  "label": "reporter shape",
  "shape": "reporter",
  "category": "Gallery",
  "returns": "string",
  "children": []
}

gallery_boolean

shape: boolean — hexagon for predicate results

boolean shape 4
scale = 0.75
fontscale = 1.500
box wid 1.441 ht 0.340 rad 0.100 with .nw at (0.035, -1.715) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.441 ht 0.340 rad 0.100 with .nw at (0.000, -1.680) fill 0x59C059 color 0x59C059
text "boolean shape" color white at (0.721, -1.850)
box wid 0.240 ht 0.220 rad 0.110 at (1.291, -1.820) fill 0x334155 color 0x334155
text "4" at (1.291, -1.820) color 0xf8fafc

crystal source

@[GPCR::Primitive(shape: :boolean, label: "boolean shape", category: "Gallery", returns: :boolean)]
def gallery_boolean : Bool
  true
end

json block

{
  "kind": "primitive",
  "name": "gallery_boolean",
  "doc": "shape: boolean — hexagon for predicate results",
  "label": "boolean shape",
  "shape": "boolean",
  "category": "Gallery",
  "returns": "boolean",
  "children": []
}

gallery_predefined_process

shape: predefined-process — rectangle with double vertical bars (ISO 5807)

predefined process shape 5
scale = 0.75
fontscale = 1.500
box wid 2.317 ht 0.340 with .nw at (0.035, -2.135) fill 0xCBD5E1 color 0xCBD5E1
box wid 2.317 ht 0.340 with .nw at (0.000, -2.100) fill 0xEC407A color 0xEC407A
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -2.123) fill 0xffffff color 0xffffff
line from (0.140, -2.100) to (0.140, -2.440) color white
line from (2.177, -2.100) to (2.177, -2.440) color white
text "predefined process shape" color white at (1.158, -2.270)
box wid 0.240 ht 0.220 rad 0.110 at (2.167, -2.240) fill 0x334155 color 0x334155
text "5" at (2.167, -2.240) color 0xf8fafc

crystal source

@[GPCR::Primitive(shape: :predefined_process, label: "predefined process shape", category: "Gallery")]
def gallery_predefined_process
end

json block

{
  "kind": "primitive",
  "name": "gallery_predefined_process",
  "doc": "shape: predefined-process — rectangle with double vertical bars (ISO 5807)",
  "label": "predefined process shape",
  "shape": "predefined_process",
  "category": "Gallery",
  "returns": null,
  "children": []
}

gallery_document

shape: document — rectangle with wavy bottom edge (ISO 5807)

document shape 6
scale = 0.75
fontscale = 1.500
box wid 1.589 ht 0.340 with .nw at (0.035, -2.555) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.589 ht 0.340 with .nw at (0.000, -2.520) fill 0xEC407A color 0xEC407A
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -2.542) fill 0xffffff color 0xffffff
ellipse wid 0.874 ht 0.109 at (0.794, -2.860) fill 0xffffff color 0xffffff
text "document shape" color white at (0.794, -2.690)
box wid 0.240 ht 0.220 rad 0.110 at (1.439, -2.660) fill 0x334155 color 0x334155
text "6" at (1.439, -2.660) color 0xf8fafc

crystal source

@[GPCR::Primitive(shape: :document, label: "document shape", category: "Gallery")]
def gallery_document
end

json block

{
  "kind": "primitive",
  "name": "gallery_document",
  "doc": "shape: document — rectangle with wavy bottom edge (ISO 5807)",
  "label": "document shape",
  "shape": "document",
  "category": "Gallery",
  "returns": null,
  "children": []
}

gallery_terminator

novel shape: terminator — pill-shaped block with no stack tabs (stop red). Proposed addition: signals script-ending statements such as "stop script". The capsule silhouette (PILL_RAD ≈ BLOCK_H/2) makes it visually distinct from command blocks and communicates that execution cannot continue below.

stop script 7
scale = 0.75
fontscale = 1.500
box wid 1.087 ht 0.340 rad 0.170 with .nw at (0.035, -2.975) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.087 ht 0.340 rad 0.170 with .nw at (0.000, -2.940) fill 0xFF4444 color 0xFF4444
text "stop script" color white at (0.543, -3.110)
box wid 0.240 ht 0.220 rad 0.110 at (0.937, -3.080) fill 0x334155 color 0x334155
text "7" at (0.937, -3.080) color 0xf8fafc

crystal source

@[GPCR::Primitive(shape: :terminator, label: "stop script", category: "Gallery")]
def gallery_terminator
end

json block

{
  "kind": "primitive",
  "name": "gallery_terminator",
  "doc": "novel shape: terminator — pill-shaped block with no stack tabs (stop red).\nProposed addition: signals script-ending statements such as \"stop script\".\nThe capsule silhouette (PILL_RAD ≈ BLOCK_H/2) makes it visually distinct\nfrom command blocks and communicates that execution cannot continue below.",
  "label": "stop script",
  "shape": "terminator",
  "category": "Gallery",
  "returns": null,
  "children": []
}

gallery_ring

novel shape: ring — concentric-pill block for first-class procedures (violet). Proposed addition: wraps a command script into a reifiable procedure value, following the GP ring-block vocabulary. The cream inner pill contrasts with the violet outer pill to create the "hollow ring" silhouette that GP uses to distinguish a procedure reference from an ordinary reporter value.

ring shape 8
scale = 0.75
fontscale = 1.500
box wid 1.106 ht 0.340 rad 0.170 with .nw at (0.035, -3.395) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.106 ht 0.340 rad 0.170 with .nw at (0.000, -3.360) fill 0x9966FF color 0x9966FF
box wid 0.797 ht 0.204 rad 0.102 with .nw at (0.155, -3.428) fill 0xFFFDE7 color 0xFFFDE7
text "ring shape" color 0x9966FF at (0.553, -3.530)
box wid 0.240 ht 0.220 rad 0.110 at (0.956, -3.500) fill 0x334155 color 0x334155
text "8" at (0.956, -3.500) color 0xf8fafc

crystal source

@[GPCR::Primitive(shape: :ring, label: "ring shape", category: "Gallery", returns: :string)]
def gallery_ring : String
  ""
end

json block

{
  "kind": "primitive",
  "name": "gallery_ring",
  "doc": "novel shape: ring — concentric-pill block for first-class procedures (violet).\nProposed addition: wraps a command script into a reifiable procedure value,\nfollowing the GP ring-block vocabulary. The cream inner pill contrasts with\nthe violet outer pill to create the \"hollow ring\" silhouette that GP uses to\ndistinguish a procedure reference from an ordinary reporter value.",
  "label": "ring shape",
  "shape": "ring",
  "category": "Gallery",
  "returns": "string",
  "children": []
}

gallery_structures

structures walk-through: one graph body exercising every node kind the renderer handles

command shape 10 if  gallery_boolean  then 11 command shape 12 else reporter shape 13 while  gallery_boolean 14 command shape 15 match  gallery_reporter when  one command shape when  two reporter shape else document shape forever 16 predefined process shape 17 stop script 18 ring shape 19
scale = 0.75
fontscale = 1.500
box wid 1.588 ht 0.340 rad 0.035 with .nw at (0.035, -3.815) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.588 ht 0.340 rad 0.035 with .nw at (0.000, -3.780) fill 0xEC407A color 0xEC407A
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -3.802) fill 0xffffff color 0xffffff
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -4.152) fill 0xEC407A color 0xEC407A
text "command shape" color white at (0.794, -3.950)
box wid 0.240 ht 0.220 rad 0.110 at (1.438, -3.920) fill 0x334155 color 0x334155
text "10" at (1.438, -3.920) color 0xf8fafc
box wid 2.720 ht 1.210 rad 0.035 with .nw at (0.035, -4.235) fill 0xCBD5E1 color 0xCBD5E1
box wid 2.720 ht 1.210 rad 0.035 with .nw at (0.000, -4.200) fill 0xFFAB19 color 0xFFAB19
box wid 2.340 ht 0.540 rad 0.035 with .nw at (0.320, -4.660) fill 0xFFFDE7 color 0xFFFDE7
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -4.223) fill 0xffffff color 0xffffff
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -5.442) fill 0xFFAB19 color 0xFFAB19
text "if " color white at (0.331, -4.430)
box wid 1.499 ht 0.205 rad 0.102 with .nw at (0.505, -4.328) fill 0xFFFFFF color 0xFFFFFF
text "gallery_boolean" color 0x263238 at (1.255, -4.430)
text " then" color white at (2.261, -4.430)
box wid 0.240 ht 0.220 rad 0.110 at (2.570, -4.340) fill 0x334155 color 0x334155
text "11" at (2.570, -4.340) color 0xf8fafc
box wid 1.588 ht 0.340 rad 0.035 with .nw at (0.455, -4.755) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.588 ht 0.340 rad 0.035 with .nw at (0.420, -4.720) fill 0xEC407A color 0xEC407A
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -4.742) fill 0xFFFDE7 color 0xFFFDE7
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -5.092) fill 0xEC407A color 0xEC407A
text "command shape" color white at (1.214, -4.890)
box wid 0.240 ht 0.220 rad 0.110 at (1.858, -4.860) fill 0x334155 color 0x334155
text "12" at (1.858, -4.860) color 0xf8fafc
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -5.092) fill 0xEC407A color 0xEC407A
box wid 2.720 ht 1.210 rad 0.035 with .nw at (0.035, -5.525) fill 0xCBD5E1 color 0xCBD5E1
box wid 2.720 ht 1.210 rad 0.035 with .nw at (0.000, -5.490) fill 0xFFAB19 color 0xFFAB19
box wid 2.340 ht 0.540 rad 0.035 with .nw at (0.320, -5.950) fill 0xFFFDE7 color 0xFFFDE7
text "else" color white at (1.360, -5.720)
box wid 1.431 ht 0.340 rad 0.170 with .nw at (0.455, -6.045) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.431 ht 0.340 rad 0.170 with .nw at (0.420, -6.010) fill 0xFF8C1A color 0xFF8C1A
text "reporter shape" color white at (1.136, -6.180)
box wid 0.240 ht 0.220 rad 0.110 at (1.701, -6.150) fill 0x334155 color 0x334155
text "13" at (1.701, -6.150) color 0xf8fafc
box wid 2.720 ht 1.210 rad 0.035 with .nw at (0.035, -6.815) fill 0xCBD5E1 color 0xCBD5E1
box wid 2.720 ht 1.210 rad 0.035 with .nw at (0.000, -6.780) fill 0xFFAB19 color 0xFFAB19
box wid 2.340 ht 0.540 rad 0.035 with .nw at (0.320, -7.240) fill 0xFFFDE7 color 0xFFFDE7
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -6.803) fill 0xffffff color 0xffffff
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -8.023) fill 0xFFAB19 color 0xFFAB19
text "while " color white at (0.550, -7.010)
box wid 1.499 ht 0.205 rad 0.102 with .nw at (0.836, -6.908) fill 0xFFFFFF color 0xFFFFFF
text "gallery_boolean" color 0x263238 at (1.586, -7.010)
box wid 0.240 ht 0.220 rad 0.110 at (2.570, -6.920) fill 0x334155 color 0x334155
text "14" at (2.570, -6.920) color 0xf8fafc
box wid 1.588 ht 0.340 rad 0.035 with .nw at (0.455, -7.335) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.588 ht 0.340 rad 0.035 with .nw at (0.420, -7.300) fill 0xEC407A color 0xEC407A
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -7.322) fill 0xFFFDE7 color 0xFFFDE7
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -7.672) fill 0xEC407A color 0xEC407A
text "command shape" color white at (1.214, -7.470)
box wid 0.240 ht 0.220 rad 0.110 at (1.858, -7.440) fill 0x334155 color 0x334155
text "15" at (1.858, -7.440) color 0xf8fafc
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -7.672) fill 0xEC407A color 0xEC407A
box wid 2.720 ht 0.340 rad 0.035 with .nw at (0.035, -8.105) fill 0xCBD5E1 color 0xCBD5E1
box wid 2.720 ht 0.340 rad 0.035 with .nw at (0.000, -8.070) fill 0xFFAB19 color 0xFFAB19
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -8.092) fill 0xffffff color 0xffffff
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -8.443) fill 0xFFAB19 color 0xFFAB19
text "match " color white at (0.555, -8.240)
box wid 1.489 ht 0.205 rad 0.102 with .nw at (0.881, -8.138) fill 0xFFFFFF color 0xFFFFFF
text "gallery_reporter" color 0x263238 at (1.626, -8.240)
box wid 2.720 ht 1.210 rad 0.035 with .nw at (0.035, -8.525) fill 0xCBD5E1 color 0xCBD5E1
box wid 2.720 ht 1.210 rad 0.035 with .nw at (0.000, -8.490) fill 0xFFAB19 color 0xFFAB19
box wid 2.340 ht 0.540 rad 0.035 with .nw at (0.320, -8.950) fill 0xFFFDE7 color 0xFFFDE7
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -9.732) fill 0xFFAB19 color 0xFFAB19
text "when " color white at (1.005, -8.720)
box wid 0.545 ht 0.205 rad 0.102 with .nw at (1.346, -8.618) fill 0xFFFFFF color 0xFFFFFF
text "one" color 0x263238 at (1.619, -8.720)
box wid 1.588 ht 0.340 rad 0.035 with .nw at (0.455, -9.045) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.588 ht 0.340 rad 0.035 with .nw at (0.420, -9.010) fill 0xEC407A color 0xEC407A
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -9.033) fill 0xFFFDE7 color 0xFFFDE7
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -9.383) fill 0xEC407A color 0xEC407A
text "command shape" color white at (1.214, -9.180)
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -9.383) fill 0xEC407A color 0xEC407A
box wid 2.720 ht 1.210 rad 0.035 with .nw at (0.035, -9.815) fill 0xCBD5E1 color 0xCBD5E1
box wid 2.720 ht 1.210 rad 0.035 with .nw at (0.000, -9.780) fill 0xFFAB19 color 0xFFAB19
box wid 2.340 ht 0.540 rad 0.035 with .nw at (0.320, -10.240) fill 0xFFFDE7 color 0xFFFDE7
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -11.023) fill 0xFFAB19 color 0xFFAB19
text "when " color white at (1.015, -10.010)
box wid 0.525 ht 0.205 rad 0.102 with .nw at (1.356, -9.908) fill 0xFFFFFF color 0xFFFFFF
text "two" color 0x263238 at (1.619, -10.010)
box wid 1.431 ht 0.340 rad 0.170 with .nw at (0.455, -10.335) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.431 ht 0.340 rad 0.170 with .nw at (0.420, -10.300) fill 0xFF8C1A color 0xFF8C1A
text "reporter shape" color white at (1.136, -10.470)
box wid 2.720 ht 1.210 rad 0.035 with .nw at (0.035, -11.105) fill 0xCBD5E1 color 0xCBD5E1
box wid 2.720 ht 1.210 rad 0.035 with .nw at (0.000, -11.070) fill 0xFFAB19 color 0xFFAB19
box wid 2.340 ht 0.540 rad 0.035 with .nw at (0.320, -11.530) fill 0xFFFDE7 color 0xFFFDE7
text "else" color white at (1.360, -11.300)
box wid 1.589 ht 0.340 with .nw at (0.455, -11.625) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.589 ht 0.340 with .nw at (0.420, -11.590) fill 0xEC407A color 0xEC407A
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -11.613) fill 0xFFFDE7 color 0xFFFDE7
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -11.963) fill 0xEC407A color 0xEC407A
ellipse wid 0.874 ht 0.109 at (1.214, -11.930) fill 0xFFFDE7 color 0xFFFDE7
text "document shape" color white at (1.214, -11.760)
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -11.963) fill 0xEC407A color 0xEC407A
box wid 2.720 ht 1.210 rad 0.035 with .nw at (0.035, -12.395) fill 0xCBD5E1 color 0xCBD5E1
box wid 2.720 ht 1.210 rad 0.035 with .nw at (0.000, -12.360) fill 0xFFAB19 color 0xFFAB19
box wid 2.340 ht 0.540 rad 0.035 with .nw at (0.320, -12.820) fill 0xFFFDE7 color 0xFFFDE7
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -12.382) fill 0xffffff color 0xffffff
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -13.603) fill 0xFFAB19 color 0xFFAB19
text "forever" color white at (1.360, -12.590)
box wid 0.240 ht 0.220 rad 0.110 at (2.570, -12.500) fill 0x334155 color 0x334155
text "16" at (2.570, -12.500) color 0xf8fafc
box wid 2.317 ht 0.340 with .nw at (0.455, -12.915) fill 0xCBD5E1 color 0xCBD5E1
box wid 2.317 ht 0.340 with .nw at (0.420, -12.880) fill 0xEC407A color 0xEC407A
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -12.902) fill 0xFFFDE7 color 0xFFFDE7
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -13.253) fill 0xEC407A color 0xEC407A
line from (0.560, -12.880) to (0.560, -13.220) color white
line from (2.597, -12.880) to (2.597, -13.220) color white
text "predefined process shape" color white at (1.578, -13.050)
box wid 0.240 ht 0.220 rad 0.110 at (2.587, -13.020) fill 0x334155 color 0x334155
text "17" at (2.587, -13.020) color 0xf8fafc
box wid 0.300 ht 0.065 rad 0.018 at (0.790, -13.253) fill 0xEC407A color 0xEC407A
box wid 1.087 ht 0.340 rad 0.170 with .nw at (0.035, -13.685) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.087 ht 0.340 rad 0.170 with .nw at (0.000, -13.650) fill 0xFF4444 color 0xFF4444
text "stop script" color white at (0.543, -13.820)
box wid 0.240 ht 0.220 rad 0.110 at (0.937, -13.790) fill 0x334155 color 0x334155
text "18" at (0.937, -13.790) color 0xf8fafc
box wid 1.106 ht 0.340 rad 0.170 with .nw at (0.035, -14.105) fill 0xCBD5E1 color 0xCBD5E1
box wid 1.106 ht 0.340 rad 0.170 with .nw at (0.000, -14.070) fill 0x9966FF color 0x9966FF
box wid 0.797 ht 0.204 rad 0.102 with .nw at (0.155, -14.138) fill 0xFFFDE7 color 0xFFFDE7
text "ring shape" color 0x9966FF at (0.553, -14.240)
box wid 0.240 ht 0.220 rad 0.110 at (0.956, -14.210) fill 0x334155 color 0x334155
text "19" at (0.956, -14.210) color 0xf8fafc
box wid 0.300 ht 0.065 rad 0.018 at (0.370, -4.152) fill 0xEC407A color 0xEC407A

crystal source

@[GPCR::Graph(x: 10, y: 10)]
def gallery_structures
  # call — plain block invocation
  gallery_command
  # if/else — conditional branch with else arm
  if gallery_boolean
    gallery_command
  else
    gallery_reporter
  end
  # while — conditional loop
  while gallery_boolean
    gallery_command
  end
  # case/when/else — dispatched match with literal and else arms
  case gallery_reporter
  when "one"
    gallery_command
  when "two"
    gallery_reporter
  else
    gallery_document
  end
  # c_call — block-passing call producing a C-shape with inner stack
  forever do
    gallery_predefined_process
  end
  # terminator — novel stop-shape block (pill, no tabs)
  gallery_terminator
  # ring — novel first-class-procedure block (concentric pills)
  gallery_ring
end

json block

{
  "kind": "graph",
  "name": "gallery_structures",
  "doc": "structures walk-through: one graph body exercising every node kind the renderer handles",
  "children": [
    {
      "kind": "call",
      "name": "gallery_command",
      "receiver": null,
      "op_index": 10,
      "args": [],
      "label": "command shape",
      "shape": "command",
      "category": "Gallery",
      "children": []
    },
    {
      "kind": "if",
      "cond": "gallery_boolean",
      "op_index": 11,
      "then": [
        {
          "kind": "call",
          "name": "gallery_command",
          "receiver": null,
          "op_index": 12,
          "args": [],
          "label": "command shape",
          "shape": "command",
          "category": "Gallery",
          "children": []
        }
      ],
      "else": [
        {
          "kind": "call",
          "name": "gallery_reporter",
          "receiver": null,
          "op_index": 13,
          "args": [],
          "label": "reporter shape",
          "shape": "reporter",
          "category": "Gallery",
          "children": []
        }
      ]
    },
    {
      "kind": "while",
      "cond": "gallery_boolean",
      "op_index": 14,
      "body": [
        {
          "kind": "call",
          "name": "gallery_command",
          "receiver": null,
          "op_index": 15,
          "args": [],
          "label": "command shape",
          "shape": "command",
          "category": "Gallery",
          "children": []
        }
      ]
    },
    {
      "kind": "case",
      "subject": "gallery_reporter",
      "op_index": 0,
      "whens": [
        {
          "kind": "when",
          "cond": "when [one]",
          "body": [
            {
              "kind": "call",
              "name": "gallery_command",
              "receiver": null,
              "op_index": 0,
              "args": [],
              "label": "command shape",
              "shape": "command",
              "category": "Gallery",
              "children": []
            }
          ]
        },
        {
          "kind": "when",
          "cond": "when [two]",
          "body": [
            {
              "kind": "call",
              "name": "gallery_reporter",
              "receiver": null,
              "op_index": 0,
              "args": [],
              "label": "reporter shape",
              "shape": "reporter",
              "category": "Gallery",
              "children": []
            }
          ]
        }
      ],
      "else": [
        {
          "kind": "call",
          "name": "gallery_document",
          "receiver": null,
          "op_index": 0,
          "args": [],
          "label": "document shape",
          "shape": "document",
          "category": "Gallery",
          "children": []
        }
      ]
    },
    {
      "kind": "c_call",
      "name": "forever",
      "op_index": 16,
      "args": [],
      "body": [
        {
          "kind": "call",
          "name": "gallery_predefined_process",
          "receiver": null,
          "op_index": 17,
          "args": [],
          "label": "predefined process shape",
          "shape": "predefined_process",
          "category": "Gallery",
          "children": []
        }
      ]
    },
    {
      "kind": "call",
      "name": "gallery_terminator",
      "receiver": null,
      "op_index": 18,
      "args": [],
      "label": "stop script",
      "shape": "terminator",
      "category": "Gallery",
      "children": []
    },
    {
      "kind": "call",
      "name": "gallery_ring",
      "receiver": null,
      "op_index": 19,
      "args": [],
      "label": "ring shape",
      "shape": "ring",
      "category": "Gallery",
      "children": []
    }
  ]
}