Skip to content

Instantly share code, notes, and snippets.

package com.michal
class A {
private def defaultPrivate = ???
private [this] def superPrivate(other: A) {
//other.superPrivate(this) // error
other.defaultPrivate
superPrivate(other)
}
private [michal] def publicInPackage = ???
case class User(name: String, lastname: String)
User(name = "Michal", lastname = "Kowol") == User(lastname = "Kowol", name = "Michal") // true
1 + 3 == (1).+(3)
!true == true.unary_!
def foo: String = ???
def bar(): String = ???
var mtv = (function (mtv) {
'use strict';
mtv.TraitA = function (self) {
self.functionA = function () {
console.log('[start]: TraitA.functionA');
console.log(self.getModel());
console.log('[end]: TraitA.functionA');
};
function _extend(object, source) {
for (var key in source) {
if (source.hasOwnProperty(key)) {
object[key] = source[key];
}
}
return object;
}
function _with() {
package pl.edu.agh.openshop
import pl.edu.agh.openshop.utils.fastfor
package object utils {
def fastfor(limit: Int)(f: Int => Unit) {
var i = 0
while (i < limit) {
f(i)
def isSorted[A](as: List[A], gt: (A, A) => Boolean): Boolean = as match {
case a :: b :: tail => {
if (!gt(a, b)) return false
isSorted(b :: tail, gt)
}
case _ => true
}