Skip to content

Instantly share code, notes, and snippets.

View yvonmanzi's full-sized avatar

Yvon Manzi yvonmanzi

View GitHub Profile
(function :Int maxFromList [ :Array<Int> list]
// Looks like variables declared inside `let` are all final. ?? Humn...
// Ooooh, you need a `&mut` to indicate mutability. ie. by default all
// variables are immutable.
(let [&mut :Int maxNumber 0]
//lovely almost pythonic syntax
(doFor number list
(set maxNumber (max maxNumber number))
)
maxNumber)
@yvonmanzi
yvonmanzi / main.dart
Created June 10, 2020 10:14
some flutter code for imperative vs declarative article
import 'package:flutter/material.dart';
import 'dart:math';
void main() => runApp(HomePage());
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
var computerName = "pc"; //Note that not all languages can infer types.
@yvonmanzi
yvonmanzi / variables1.dart
Created June 10, 2020 08:53
guide to variables in dart
String computerName = "mac";