Questions tagged [chainable]

19 questions
0
votes
1 answer

Is it possible to provide default implementation of chainable trait methods?

The goal would be to have something similar to (playground): trait T { fn get_mutable_attribute(&mut self) -> &mut String; fn forwardable_append_attribute(mut self, new_value: &str) -> Self { let attribute =…
aeon
  • 83
  • 3
  • 6
0
votes
3 answers

PHP methods return array and still be chainable

I'm quite sure this isn't possible but I'm really hoping its gonna be possible. i want to call my models in this way for instance $getAll = models\company::getInstance()->getAll("ID < 4") which is basicaly just class company extends _ { private…
WilliamStam
  • 254
  • 2
  • 13
0
votes
1 answer

IIFE chainable not returning correctly

(function (w, d, u) { /* Variable Conventions _*VAR*_ is html or class text*/ var wl = '^\\/t\\d+', ps = '^\\/post', pv = '\\/privmsg\\?.+(post|reply){1}(.*)?', _GROUP_ = null, i, _CLASS_ = "sceditor-button…
EasyBB
  • 6,176
  • 9
  • 47
  • 77
0
votes
5 answers

Are python methods chainable?

s = set([1,2,3]) I should be elegant to do the following: a.update(s).update(s) I doesn't work as I thought make a contains set([1,2,3,1,2,3,1,2,3]) So I'm wandering that Does Python advocate this chainable practise?
mko
  • 21,334
  • 49
  • 130
  • 191
1
2